FORMS
Combobox
Searchable single-select. Trigger looks like Select; the dropdown content uses cmdk for fuzzy matching plus the Damo Memphis chrome on the popover.
Import
Basic usage
Controlled
Manage the selection externally for validation or persistence.
Props
Combobox props
| Prop | Type | Default | Description |
|---|---|---|---|
| options* | ComboboxOption[] | — | Items to render — { value, label, disabled? }. |
| value | string | — | Controlled selected value. Pair with onValueChange. |
| defaultValue | string | — | Uncontrolled initial selected value. |
| onValueChange | (value: string) => void | — | Fires when an option is picked. |
| placeholder | ReactNode | 'Scegli…' | Trigger text shown when nothing is selected. |
| searchPlaceholder | string | 'Cerca…' | Placeholder inside the search input. |
| emptyMessage | ReactNode | 'Nessun risultato' | Shown when the search yields no results. |
| disabled | boolean | — | Disables the trigger. |
| id | string | — | id forwarded to the trigger button (label association). |
| className | string | — | Tailwind classes merged onto the trigger. |
Combobox vs Select
- Reach for Combobox when the option list is long enough that scrolling alone is friction (≥ ~10 options) or when users will search by typed input.
- Reach for Select for short lists (2-9 items) where keyboard arrow navigation is sufficient.
Native form submission
Combobox renders a <button> + popover with no hidden form input and no name prop. To submit through a traditional <form>, manage the value with React state and either render your own hidden input or read it from the submit handler.
Accessibility
- The trigger is a plain
<button>(norole="combobox") witharia-expandedreflecting the popover state. This is a button-plus-popover pattern, not the full WAI-ARIA combobox pattern that Select provides. - The dropdown list is rendered by
cmdk: type to filter, arrows to move, Enter to select, Esc to close. - Use
FormFieldor pairidwith a siblingLabelso screen readers announce the field name.