Combobox

A field that filters a list as the user types. Reach for it once the values run past a screenful, come from a server, or more than one can be chosen. Below that, a Select is the smaller thing that does the job.

Reach for it

Search, async options, or more than one value at a time.

Not for

A handful of fixed options with no search. A Select is less machinery.

One value

Type to filter, arrow keys to move, Enter to choose. The empty and loading labels are required, because what to say when a search finds nothing is copy and the package ships none.

Type to filter. Base UI matches on contains.

Selected: nothing

Several values

isMulti changes the shape of the value as well as the field: the chosen options come back as an array, and each one can be removed from the field without reopening the list.

Selections become chips. Backspace removes the last one.

1 selected

A richer row

renderOption draws the row while the component keeps the keyboard behaviour, the filtering and the ARIA wiring. Use it when the label alone cannot tell two options apart.

renderOption draws the list row. The input still shows the plain label, because an input holds text.

Grouped options

Groups are headings inside the list, announced as such. They suit a list with a natural split, and they are not a substitute for filtering a list that is simply too long.

Loaded from a server

onSearchChange hands you the query and you supply the options, so debouncing, cancelling and caching stay in your data layer. onScrollToEnd fires when the list nears its end, which is where the next page belongs.

Type to search. The results arrive after a delay, and the status is announced.

Sizes

The same three sizes every control in the system shares, so a combobox lines up with the inputs beside it.

API reference

Combobox

PropTypeDefaultDescription
options*TOption[] | ComboboxOptionGroup<TOption>[]-A flat list, or groups. A group renders its own label above its options.
placeholder*string-Shown while the box is empty. Copy is always passed in.
emptyLabel*string-Shown when nothing matches what was typed.
loadingLabel*string-Announced politely while the list loads, and shown above it.
data-testidstring-Names the element for a test. Never rendered, never announced.
size'small' | 'medium' | 'large'medium
hasStartAdornmentbooleanfalseRoom for a marker or a button inside the control's own padding box. The padding belongs to the control, so it lives here. The marker's own geometry belongs to the marker, so it lives in adornment.ts. Four components each carried the whole table before, and the one in combobox.tsx said "mirroring SearchInput" in a comment, which is the note a copy leaves behind.
hasEndAdornment'true' | 'false' | 'double'false`double` is two markers at the end, a clear button beside a calendar button. Twice the room, so the value never runs under either of them.
isLoadingboolean-
isDisabledboolean-
namestring-
ariaLabelstring-Names the control when it is used outside a Field. `ariaLabel` rather than `label`, which is what this was: Checkbox and Switch take a `label` that is text the user reads, and one name for two opposite things in the same folder is how a caller ends up with an invisible label they meant to be visible.
clearLabelstring-Names the clear button, and its presence is what adds one. A boolean plus a label would be two props describing one decision, and the button cannot exist without a name anyway.
renderOption(option: TOption) => ReactNode-Custom content for an option in the list. react-select's `formatOptionLabel` also renders the selected value. It cannot here: the selection lives inside an `<input>`, which holds text and nothing else, so `label` is what a chosen option reads as.
filterOption(option: TOption, query: string) => boolean-Replaces the built-in match. Equivalent to react-select's `filterOption`.
onSearchChange(query: string) => void-Fired as the user types, for a server-side search. Providing it turns the client-side filter off, because the options that come back are already the answer to the query and filtering them again drops every row whose label does not literally contain what was typed. Pass `filterOption` as well to search remotely and still filter locally.
onScrollToEnd() => void-Fired when the list is scrolled to its end, once per arrival.
isOpenboolean-
onOpenChange(isOpen: boolean) => void-
isMultifalse-
valueTOption | null-The selected option, not its id. With a server-side search the list is transient, so an id alone loses its label the moment the options are replaced by the next query's.
defaultValueTOption | null-
onValueChange(option: TOption | null) => void-
chipRemoveLabel(option: TOption) => string-Names each chip's remove button, given the option it removes.