Elements

Components

Listbox

Listbox, dressed in the paper-and-ink system: quiet rows of ink where the checked row alone takes the flat primary fill. The parts — Root, Label, Input, Content, Empty, Item, ItemText, ItemIndicator, ItemGroup, ItemGroupLabel, ValueText; the collections live in the shared collection module.

#Basic usage

listbox/basic Vue React
Accent
Qinghua cobalt
Celadon
Zhusha cinnabar
Ochre

#Props

#Content

A styled part — no props of its own; it takes the anatomy's shared styling.

#Empty

A styled part — no props of its own; it takes the anatomy's shared styling.

#Input

PropTypeDefaultDescription
autoHighlightboolean | undefinedfalseWhether to automatically highlight the item when typing
keyboardPriority"caret" | "navigate" | undefined"caret"Determines how keyboard conflicts in the input are resolved. - "caret": keep native text-editing behavior - "navigate": forward supported keys to listbox navigation

#ItemContext

A styled part — no props of its own; it takes the anatomy's shared styling.

#ItemGroupLabel

A styled part — no props of its own; it takes the anatomy's shared styling.

#ItemGroup

A styled part — no props of its own; it takes the anatomy's shared styling.

#ItemIndicator

A styled part — no props of its own; it takes the anatomy's shared styling.

#ItemText

A styled part — no props of its own; it takes the anatomy's shared styling.

#Item

PropTypeDefaultDescription
highlightOnHoverboolean | undefinedWhether to highlight the item on hover
itemTThe item to render

#Label

A styled part — no props of its own; it takes the anatomy's shared styling.

#Root

PropTypeDefaultDescription
sizeString as PropType<"sm" | "md" | "lg">"md"One rung of the ladder for the row register and the filter field.
collectionListCollection<T>The collection of items
defaultHighlightedValuestringThe initial value of the highlighted item when opened. Use when you don't need to control the highlighted value of the listbox.
defaultValuestring[][]The initial default value of the listbox when rendered. Use when you don't need to control the value of the listbox.
deselectablebooleanWhether to disallow empty selection
disabledbooleanWhether the listbox is disabled
disallowSelectAllbooleanWhether to disallow selecting all items when meta+a is pressed
highlightedValuestringThe controlled key of the highlighted item
idstringThe unique identifier of the machine.
idsPartial<{ root: string; content: string; label: string; item(id: string | number): string; itemGroup(id: string | number): string; itemGroupLabel(id: string | number): string; }>The ids of the elements in the listbox. Useful for composition.
loopFocusbooleanfalseWhether to loop the keyboard navigation through the options
modelValuestring[]The model value of the listbox
orientation'horizontal' | 'vertical'"horizontal"The orientation of the element.
scrollToIndexFn(details: listbox.ScrollToIndexDetails) => voidFunction to scroll to a specific index
selectionModelistbox.SelectionMode"single"How multiple selection should behave in the listbox. - single: The user can select a single item. - multiple: The user can select multiple items without using modifier keys. - extended: The user can select multiple items by using modifier keys.
selectOnHighlightbooleanWhether to select the item when it is highlighted
typeaheadbooleanWhether to enable typeahead on the listbox

#ValueText

PropTypeDefaultDescription
placeholderstring—