<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
| Prop | Type | Default | Description |
|---|---|---|---|
gap | SpaceValue | 1 | Space between items: a spacing step, or "12px". |
ui | Record<string, unknown> | {} | Escape hatch: raw uikit (@pmndrs/uikit) properties, merged last. |
maxHeight | number | 240 | Height (dmm) above which the list scrolls. |
<XrListItem>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
ui | Record<string, unknown> | {} | Escape hatch: raw uikit (@pmndrs/uikit) properties, merged last. |
disabled | boolean | Greyed out; it does not react. | |
parts | Partial<Record<"label" | "description", Record<string, unknown>>> | Raw uikit properties per inner part, merged after the defaults: label, description. | |
selected | boolean | Highlighted as the current one. | |
label | string | The main text. The default slot replaces label and description. | |
description | string | A second, muted line under the label. |
Events
| Event | Payload | Description |
|---|---|---|
click | event: ControlPointerEvent | Tapped, with any input. Not emitted when the list is dragged from it. |