Combobox
A searchable single-select built on the ARIA combobox pattern.
- Forms
- 1 file
- 1 npm package
- Accessibility notes
pnpm dlx @dowel-ui/cli add comboboxnpm packages installed: radix-ui.
import { Combobox } from "@/components/ui/combobox";Default
Hidden Keywords
Rich Options
With Disabled Option
Controlled
Long List
Async Search
Clearable And Deselectable
<Combobox>
| Prop | Type | Default |
|---|---|---|
allowDeselectChoosing the selected option again clears it, reporting | boolean | false |
defaultOpen | boolean | false |
defaultValue | string | — |
filterOverrides how a search string is matched against an option. | (search: string, haystack: string[]) => boolean | defaultComboboxFilter |
loadingResults are on their way: the listbox is | boolean | false |
onOpenChange | (open: boolean) => void | — |
onSearchChangeCalled as the search text changes, including the reset when it closes. | (search: string) => void | — |
onValueChange | (value: string) => void | — |
open | boolean | — |
searchDebounceMilliseconds of quiet typing before | number | 0 |
shouldFilterSet | boolean | true |
value | string | — |
children | ReactNode | — |
<ComboboxTrigger>
| Prop | Type | Default |
|---|---|---|
placeholderShown when nothing is selected. | string | "Select…" |
Plus every attribute of <button>.
<ComboboxContent>
| Prop | Type | Default |
|---|---|---|
labelNames the popover, which carries role="dialog". | string | "Search options" |
Every prop of Radix UI’s Popover.Content, plus className.
<ComboboxInput>
| Prop | Type | Default |
|---|---|---|
clearableShows a button that clears the search while there is text to clear. | boolean | false |
Plus every attribute of <input> except value, onChange.
<ComboboxList>
Plus every attribute of <div>.
<ComboboxItem>
| Prop | Type | Default |
|---|---|---|
value (required)The value reported by onValueChange, and the primary search term. | string | — |
disabled | boolean | — |
keywordsExtra search terms that are not shown, such as synonyms or an id. | string[] | — |
children | ReactNode | — |
Plus every attribute of <div> except onSelect, children.
<ComboboxEmpty>
Plus every attribute of <div>.
<ComboboxLoading>
Plus every attribute of <div>.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes