Combobox
A searchable input for choosing one or more values.
Default
Type to filter. The first match is highlighted, so Enter selects it without a click. ComboboxEmpty shows when nothing matches.
Sizes
The default size is sm (36px). md is 40px.
Variants
Primary is a flat neutral-100 field and is the default. Secondary is white with shadow-sm, for tinted panels.
Clear
Set showClear to swap the chevron for a clear button once a value is chosen.
Groups
Pass grouped items and render each as a ComboboxGroup with a ComboboxLabel. Labels hide while the input has a query.
Multiple
Set multiple and render values as ComboboxChip inside ComboboxChips. Anchor the popup to the chips with useComboboxAnchor.
Selected first
Wrap the list in ComboboxSelectionGroups to show chosen options above the rest, with optional section labels.
Disabled
Set disabled on both Combobox and ComboboxInput so the field and its chevron stop responding.
Best practices
When to use
- Use when a value comes from a known list and typing to filter that list is useful, such as agents, models, or tags.
- Use Select for a short fixed list and Input for genuinely free-form values.
Behavior
- Filter from ComboboxInput or ComboboxChipsInput. The popup lists matches only; do not add a separate search field inside it.
- The first filtered match is highlighted by default, so Enter selects it without a click, like Command search.
- Always include ComboboxEmpty with a specific message, like “No agents found.”. When nothing matches, the list hides and that single row shows.
- Section labels hide while the input has a filter query.
- Use showClear when clearing the value is a normal action; it replaces the chevron once a value is set.
- For multiple values, render ComboboxChip inside ComboboxChips and anchor ComboboxPopup to the chips with useComboboxAnchor.
- Wrap the list in ComboboxSelectionGroups when chosen options should stay above the rest.
Accessibility
- Keep the input name stable (FieldLabel or aria-label) and return focus to it when the popup closes.
- Set disabled on both Combobox and ComboboxInput so the field and its chevron are both inert.