R

Listbox

7 parts

Anatomy

Import the parts and compose them. Each part forwards attributes to its underlying element.

vue
import {
  ListboxRoot,
  ListboxContent,
  ListboxItem,
  ListboxItemIndicator,
  ListboxGroup,
  ListboxGroupLabel,
  ListboxFilter,
} from '@robonen/primitives/listbox';

<ListboxRoot>
  <ListboxContent />
  <ListboxItem />
  <ListboxItemIndicator />
  <ListboxGroup />
  <ListboxGroupLabel />
  <ListboxFilter />
</ListboxRoot>

API Reference

ListboxRoot

Root
PropTypeDescription
modelValue?U | U[]Controlled value. Use `v-model`.
defaultValue?U | U[]Uncontrolled initial value.
multiple?booleanAllow multiple selection.
orientation?ListboxOrientationNavigation orientation.
dir?ListboxDirectionReading direction. Falls back to `ConfigProvider`.
disabled?booleanDisable the whole listbox.
selectionBehavior?ListboxSelectionBehaviorHow selection behaves in `multiple` mode.
highlightOnHover?booleanHighlight items on hover.
by?string | ((a: U, b: U) => boolean)Compare objects by key or custom comparator.

ListboxContent

Content

No props or events — renders its element and forwards attributes.

ListboxItem

Item
PropTypeDescription
valueUThe value of the item.
disabled?booleanDisable this item.

ListboxItemIndicator

ItemIndicator

No props or events — renders its element and forwards attributes.

ListboxGroup

Group

No props or events — renders its element and forwards attributes.

ListboxGroupLabel

GroupLabel

No props or events — renders its element and forwards attributes.

ListboxFilter

Filter
PropTypeDescription
modelValue?stringControlled input value.
autoFocus?booleanFocus on mount.
disabled?booleanDisable input.