Combobox
An autocomplete input with a filterable dropdown list. Supports controlled and uncontrolled modes.
Filterable List
Empty State
Keyboard
Type to filter: the first match is highlighted, so typing "new y" then Enter picks New York. Arrow Down and Arrow Up move the highlight (Oregon is disabled and is skipped), Home and End jump to the ends, Enter picks, Escape closes and a second Escape clears the text. Tab picks nothing. Focus stays in the text field throughout.
Installation
npx visor add comboboxThis copies two files into your project:
components/ui/combobox/combobox.tsx— the componentcomponents/ui/combobox/combobox.module.css— the styles
Usage
import {
Combobox,
ComboboxInput,
ComboboxContent,
ComboboxItem,
ComboboxEmpty,
} from '@/components/ui/combobox/combobox';
<Combobox>
<ComboboxInput placeholder="Pick a fruit..." />
<ComboboxContent>
<ComboboxItem value="apple">Apple</ComboboxItem>
<ComboboxItem value="banana">Banana</ComboboxItem>
<ComboboxEmpty>No results found.</ComboboxEmpty>
</ComboboxContent>
</Combobox>API Reference
ComboboxProps
| Prop | Type | Default | Description |
|---|---|---|---|
inputValue | string | — | Controlled value of the search input. |
onInputChange | (value: string) => void | — | Callback when the input value changes. |
value | string | — | Controlled selected value. |
onSelect | (value: string) => void | — | Callback when an item is selected. |
open | boolean | — | Controlled open state of the dropdown. |
onOpenChange | (open: boolean) => void | — | Callback when the open state changes. |
Sub-components
| Component | Element | Purpose |
|---|---|---|
Combobox | <div> | Root provider managing open state, input value, and selection |
ComboboxInput | <input> | Text input with role="combobox" for typing and filtering |
ComboboxContent | <div> (portal) | Popover dropdown containing the listbox |
ComboboxItem | <li> | Selectable option with role="option" and check indicator |
ComboboxEmpty | <li> | Placeholder shown when no options match the filter |
ComboboxGroup | <li> | Groups related options under an optional heading |
ComboboxSeparator | <li> | Visual divider between groups or items |
Accessibility
- Input renders with
role="combobox",aria-expanded, andaria-autocomplete="list" - The dropdown list renders with
role="listbox"; each option hasrole="option" - Focus stays in the input;
aria-activedescendantnames the highlighted option, and each option has a stableid - Keyboard: typing highlights the first match; Arrow Down opens the list and moves down, Arrow Up moves up, Home/End jump to the ends (no wrap), disabled options are skipped; Enter picks, Escape closes (a second Escape clears the text), Tab picks nothing
- Hovering an option moves the same highlight the keys move
- Screen readers announce the number of available options when the list opens
Color Picker
An OKLCH-based color picker with a 2D lightness/chroma plane, hue slider, hex input, and optional preset chips. Renders inline or in a Radix Popover.
Composer
AI-chat composer — a rounded card container with an auto-growing text field, a tools row for icon buttons and status chips, and a circular primary send button.