Combobox
FREEAutocomplete field that filters, highlights matches, picks with the keyboard, creates new values and loads async.
Installation
Terminal
npx @bloxa/cli add combobox
# or: npx shadcn@latest add @bloxa/comboboxPackages installed automatically: radix-ui
Examples
Suggestions and create
Type, use the arrows and press Enter. The second field can create new values.
Server search
API reference
Every component also accepts the props of the element it renders.
Combobox
| Prop | Type | Default | Description |
|---|---|---|---|
| options | (string | { value, label?, description?, icon?, disabled? })[] | — | Suggestions. |
| value / onValueChange | string / (value) => void | — | Text in the field. |
| onSelect | (option) => void | — | When a suggestion is picked. |
| strict | boolean | false | Only accept listed options. |
| creatable / onCreate | boolean / (value) => void | false | "Create" option. |
| loading | boolean | false | Loading spinner. |
| filter | boolean | true | Built-in filtering; turn off when the server filters. |