Skip to content

<XrList> ​

A scrolling list. Drag with a ray or a finger, or use the mouse wheel. Items have a label, a description and a selected state, and a drag never selects. <XrListItem> is documented on this page too.

Usage ​

vue
<XrList :max-height="220">
  <XrListItem
    v-for="track in tracks"
    :key="track.title"
    :label="track.title"
    :description="track.artist"
    :selected="playing === track.title"
    @click="playing = track.title"
  />
</XrList>

API ​

Props ​

PropTypeDefaultDescription
gapSpaceValue1Space between items: a spacing step, or "12px".
uiRecord<string, unknown>{}Escape hatch: raw uikit (@pmndrs/uikit) properties, merged last.
maxHeightnumber240Height (dmm) above which the list scrolls.

<XrListItem> ​

Props ​

PropTypeDefaultDescription
uiRecord<string, unknown>{}Escape hatch: raw uikit (@pmndrs/uikit) properties, merged last.
disabledbooleanGreyed out; it does not react.
partsPartial<Record<"label" | "description", Record<string, unknown>>>Raw uikit properties per inner part, merged after the defaults: label, description.
selectedbooleanHighlighted as the current one.
labelstringThe main text. The default slot replaces label and description.
descriptionstringA second, muted line under the label.

Events ​

EventPayloadDescription
clickevent: ControlPointerEventTapped, with any input. Not emitted when the list is dragged from it.

MIT License