Homelogologo
Sponsor

Listbox

Designed to present a list of choices for user selection.

Usage

A versatile UI element that allows users to select one or more options from a predefined list. It is commonly used in forms, dropdown menus, and other interactive interfaces where selection is required.

import { Listbox } from "@elemnts-ui/react" <Listbox> <Listbox.Label /> <Listbox.Content> <Listbox.Item> <Listbox.ItemText /> <Listbox.ItemIndicator /> </Listbox.Item> </Listbox.Content> </Listbox>

Disabled

Mark certain items in the listbox as disabled to show they are not selectable, while still displaying them for informational purposes.

With Checkmark

Use custom checkmarks to indicate selected items in scenarios that allow multiple selections, ensuring clear visual distinction for users.

API Reference

ListboxRoot

Manages selection state and keyboard navigation.

PropTypeDefault
collectionListCollection<T>undefined
valuestring[]undefined
defaultValuestring[]undefined
onValueChange(details: ValueChangeDetails<T>) => voidundefined
selectionMode'single' | 'multiple' | 'extended''single'
orientation'horizontal' | 'vertical''vertical'
disabledbooleanfalse
deselectablebooleanfalse
loopFocusbooleanfalse
asChildbooleanfalse

ListboxContent

Manages the content of the listbox, including the list of items and their layout.

PropTypeDefault
asChildbooleanundefined

ListboxItem

A single selectable item in the listbox.

PropTypeDefault
itemTundefined
asChildbooleanfalse

ListboxItemText

Text content for the listbox item.

PropTypeDefault
asChildbooleanfalse

ListboxItemIndicator

Indicates the selected state of the listbox item.

PropTypeDefault
asChildbooleanfalse

ListboxItemGroup

Groups items in the listbox.

PropTypeDefault
asChildbooleanfalse

ListboxItemGroupLabel

Labels the group of items in the listbox.

PropTypeDefault
asChildbooleanfalse

ListboxValueText

Displays the selected value text in the listbox.

PropTypeDefault
asChildbooleanfalse
placeholderstringundefined

ListboxEmpty

Shown when the listbox is empty.

PropTypeDefault
asChildbooleanfalse