Appearance
List
The list component is used to display a vertical collection of structured text items in 3D space.
It organizes information into clearly separated entries, each containing a title and optional supporting text, making it easier to scan and read content in spatial interfaces.
Examples
Basic List
This example demonstrates the simplest usage of the list component. It renders a vertical list of text items using the default layout (type="text"), with only textcolor and items customized.
Custom Styling and Sizing
This example shows how to customize the visual appearance of the list using the card type, along with color, width, and size adjustments.
Multi-line and Width Behavior
This example demonstrates how the list handles long subtitles and varying widths. The left list uses a wider layout, allowing text to occupy fewer lines. The right list is narrower, forcing content to wrap across multiple lines
Props
| Property | Type | Default | Description |
|---|---|---|---|
| visible | boolean | true | Determines whether the list is visible in the scene. |
| position | number[] | 0 0 0 | Defines the 3D position of the list in the format [x, y, z]. |
| size | enum (small, medium, large) | medium | Controls overall scaling, including text size, spacing, and item proportions. |
| width | number | 1 | Sets the width of the list in meters. Affects text wrapping and layout density. |
| opacity | number | 1 | Specifies the opacity of the component. |
| textcolor | string | "black" | Sets the color of the text content (titles and subtitles). |
| color | string | "#ECECEC" | Defines the background color used in the card layout. The highlight color of a selected item is automatically derived from this value. |
| items | array | [] | Array of objects representing list items. |
| type | enum (text, card) | text | Determines the visual style of the list. text is minimal, card adds background containers. |
Events
The list component emits the following events when interacted with:
| Event | Parameters | Description |
|---|---|---|
| selected | { item: object, index: number } | Emitted when a list item is selected. Returns the selected item data and its index in the array. |
