Combobox
A text input with a filterable list of options. Use it when a select is too long to scan, or when users need to type to find an option.
StableKeyboardAccessible
Overview
The combobox keeps focus in the input while the list filters. Options can be static or loaded from a server as the user types.
Selection is single by default. Pass a multiple flag to keep the list open and show each selected value as a chip.
Preview
- Apple
- Apricot
- Banana
- Blueberry
Usage
Render the input and its options as children. The component handles focus, filtering, and the active option.
<Combobox placeholder="Search fruit">
<ComboboxItem value="Apple" />
<ComboboxItem value="Banana" />
</Combobox>Give each option a text value. The filter matches that value, so keep labels short and unique.
Keyboard
- ArrowDown opens the list and moves to the next option.
- Enter selects the active option.
- Escape closes the list and clears the filter.