flexDirection, gap, padding).UIKitDocument takes target width/height in meters and computes a uniform scale so your UI fits the desired physical size in XR.Container — generic layout node (flex)Text — MSDF text with wrappingImage / Video / Svg — media and vector contentInput / Textarea — basic UI controlsPanelUISystem configures reversePainterSortStable for you.import { Root, Container, Text, reversePainterSortStable } from '@pmndrs/uikit';
const root = new Root(camera, renderer, {
width: 1000,
height: 500,
padding: 10,
});
scene.add(root);
const panel = new Container({ flexDirection: 'row', gap: 8 });
panel.add(new Text({ text: 'Hello XR' }));
root.add(panel);
renderer.setTransparentSort(reversePainterSortStable);
renderer.setAnimationLoop((t) => root.update(t));
Root yourself..uikitml; the SDK interprets it into UIKit components at runtime, wraps it in a UIKitDocument, and manages size and placement.flexDirection, justifyContent, alignItems, gap, padding, margin, flexGrow, flexShrink, flexBasis, width, height, minWidth, minHeight, maxWidth, maxHeight.UIKitDocument.setTargetDimensions(...).hover, active, focus, sm..2xl) that toggle based on state and media hints.@pmndrs/msdfonts; glyphs are instanced for performance.hover, active, focus influence styles declaratively.reversePainterSortStable).classList. Toggle classes to switch visual states or themes at runtime.const doc = entity.getValue(PanelDocument, 'document');
const card = doc?.querySelector('.card');
card?.classList.add('selected');