<XrPanel>
A floating surface and a flex container with the theme's background. With a position it is a root in the scene; inside another component it is a card.
Usage
vue
<XrPanel :position="[0, 1.45, -1]" :width="440" :gap="4">
<XrText variant="title">Today</XrText>
<XrPanel variant="sunken" :padding="4">
<XrText muted>Nested panels are cards.</XrText>
</XrPanel>
</XrPanel>API
Props
| Prop | Type | Default | Description |
|---|---|---|---|
direction | "row" | "column" | "row-reverse" | "column-reverse" | 'column' | Main axis: children stacked (column) or side by side (row). |
wrap | boolean | Wrap children onto more lines when they do not fit. | |
ui | Record<string, unknown> | {} | Escape hatch: raw uikit (@pmndrs/uikit) properties, merged last. |
variant | "surface" | "raised" | "sunken" | 'surface' | Background: surface (the panel), raised (a card over it) or sunken (a well in it). |
distance | number | Reading distance in metres for a root panel. Scales it to keep the same angular size. | |
gap | SpaceValue | Space between children: a step on the theme's spacing scale (0..8), or "12px" in dmm. | |
padding | SpaceValue | Space inside the edges: a spacing step, or "12px". | |
align | "flex-start" | "center" | "flex-end" | "stretch" | "baseline" | Cross-axis alignment of the children (CSS align-items). | |
justify | "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly" | Main-axis distribution of the children (CSS justify-content). | |
grow | number | Share of the parent's free space to take (CSS flex-grow). | |
width | Size | Width in dmm, a percentage of the parent ("50%"), or auto. | |
height | Size | Height in dmm, a percentage of the parent, or auto. | |
material | "glass" | "metal" | "plastic" | Lit material preset for the background. |