Skip to content

<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 ​

PropTypeDefaultDescription
direction"row" | "column" | "row-reverse" | "column-reverse"'column'Main axis: children stacked (column) or side by side (row).
wrapbooleanWrap children onto more lines when they do not fit.
uiRecord<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).
distancenumberReading distance in metres for a root panel. Scales it to keep the same angular size.
gapSpaceValueSpace between children: a step on the theme's spacing scale (0..8), or "12px" in dmm.
paddingSpaceValueSpace 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).
grownumberShare of the parent's free space to take (CSS flex-grow).
widthSizeWidth in dmm, a percentage of the parent ("50%"), or auto.
heightSizeHeight in dmm, a percentage of the parent, or auto.
material"glass" | "metal" | "plastic"Lit material preset for the background.

MIT License