Combobox
Live example
Combobox
Installation
npx shadcn@latest add https://hextech-ui.vercel.app/r/combobox.jsonAPI reference
These are the main Combobox options. See the exported TypeScript types for inherited native or primitive props.
| Prop | Type | Default |
|---|---|---|
label | string (required) | — |
options | readonly T[] | required |
getOptionKey | (option: T) => string | number | string/id/value |
itemToStringLabel | (option: T) => string | string/label |
renderOption / isOptionDisabled | row renderer / disabled predicate | — |
value / defaultValue | T | null | — |
clearOnEscape | boolean; closed Escape clears only when enabled | false |
size | small | medium | large | medium |
Controlled object selection
Keep the selected record in React state. Provide stable keys and a readable string label when options are objects; do not use the object index as its identity. Use defaultValue when the component should own selection.
Live example