Listbox
import * as Listbox from '@dxos/react-ui/Listbox';A listbox is a list the user selects one, several or no items from. It handles the keyboard, typeahead and selection.
@dxos/react-ui-list builds its Listbox on this one.
| Part | What it is |
|---|---|
Listbox.Root |
The root, which holds the items and the selection |
Listbox.Label |
The list’s name |
Listbox.Viewport |
A scroll area, for a list that scrolls by itself |
Listbox.Content |
The list element |
Listbox.Item |
One row |
Listbox.ItemIcon |
The row’s icon |
Listbox.ItemText |
The row’s label. The option’s label by default |
Listbox.ItemDescription |
A second line under the label. The option’s description by default |
Listbox.ItemIndicator |
The check shown while the row is selected |
Listbox.ItemGroup |
A group of rows |
Listbox.ItemGroupLabel |
The group’s name |
Listbox.Empty |
The placeholder shown while there are no items |
Listbox.useContext |
A hook that returns the selection and its setters, for parts inside Listbox.Root |