Combobox
stableAn autocomplete input with a filtered list of options.
Basic usage
Examples
Controlled value
Track the selected value externally to drive other parts of the UI.
Large searchable collection
Combobox is useful when users need to search through application data.
Features
- Search filtering.
- Keyboard navigation.
Installation
bash
pnpm dlx structyl add comboboxAPI Reference
Combobox.Root
A searchable autocomplete select.
| Prop | Type | Default |
|---|---|---|
| value | stringControlled selected value. | — |
| onValueChange | (value: string) => voidCalled when the selection changes. | — |
| inputValue | stringControlled input text. | — |
| onInputValueChange | (value: string) => voidCalled when the input text changes. | — |
| open | booleanControlled open state. | — |
| onOpenChange | (open: boolean) => voidCalled when open state changes. | — |
| disabled | booleanDisable the combobox. | false |
Combobox.Input
The search input.
| Prop | Type | Default |
|---|---|---|
| className | stringAdditional Tailwind classes, merged with the component defaults. | — |
Combobox.Content
The results listbox.
| Prop | Type | Default |
|---|
Combobox.Item
A result option.
| Prop | Type | Default |
|---|---|---|
| value | stringThe option value. | — |
| disabled | booleanDisable the option. | — |
Combobox.Empty
Shown when no results match.
| Prop | Type | Default |
|---|