Components · Form Controls
Combobox
Command-palette style searchable dropdown built on cmdk.
import { Combobox } from '@nexub/react';Examples
Default
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| Combobox.Root | compound | — | Root cmdk command container. |
| Combobox.Input | compound | — | Search input that filters the list. |
| Combobox.List | compound | — | Scrollable list container for groups and items. |
| Combobox.Group | compound | — | Labeled group of items within the list. |
| Combobox.Item | compound | — | Individual selectable option. |
| Combobox.Empty | compound | — | Content shown when no items match the search query. |
| Combobox.Separator | compound | — | Visual separator between groups or items. |
Design tokens
Combobox reads these component tokens. Each one is unset by default and falls back to the semantic role it aliases, so nothing changes until you set it. Set one on any element to restyle every Combobox below it, and leave the roles other components share alone. See the three token tiers.
Input, Textarea, Select and Combobox triggers.
| Token | Aliases | Notes |
|---|---|---|
| --field-bg | --color-surface-container-lowest | — |
| --field-fg | --color-on-surface | — |
| --field-border | --color-outline | — |
| --field-radius | --shape-field | — |
/* One area of your app */
.checkout {
--field-bg: var(--color-secondary);
}On iOS & Android: ComboboxField
import { ComboboxField } from '@nexub/react-native';
<ComboboxField label="City" options={cities} value={city} onValueChange={setCity} onSearch={searchCities} />Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Menu | A popover listbox under the field; type to filter. | Opens a BottomSheet with a search box and the results list. |
| Async search | onSearch and loading; you debounce. | onSearch may return a promise; the field debounces (searchDebounce), ignores stale answers and shows loading, error and empty rows. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
ComboboxField props
| Prop | Type | Default | Description |
|---|---|---|---|
| labelrequired | string | — | Visible label above the field; also the sheet's title and part of the field's accessible name. |
| optionsrequired | readonly ComboboxOption[] | — | The choices. With an async onSearch, these show until the first search answers. |
| value | string | null | — | The picked option's value; null (or undefined when uncontrolled) for none. |
| defaultValue | string | null | null | The value to start with when uncontrolled. |
| onValueChange | (value: string | null) => void | — | Called with the picked value, or null when the "none" option is picked. |
| placeholder | string | 'Select…' | Shown in the field when nothing is picked. |
| searchPlaceholder | string | 'Search…' | The search box's placeholder. |
| emptyText | string | 'No results found.' | Shown when the search finds nothing. |
| noneOption | string | — | A first option that clears the value (null), labelled with this text, e.g. "No manager". |
| onSearch | AsyncSearch<ComboboxOption> | — | Async search, called with the typed text after searchDebounce. Return a promise of options
and the sheet shows them, with a loading row while it runs and a retry row if it rejects; an
answer that arrives after a newer search started is ignored. Return nothing to set options
and loading yourself, as on web. Either way the list is not filtered here. |
| searchDebounce | number | 300 | Milliseconds to wait after the last keystroke before onSearch runs. |
| loading | boolean | — | The options are loading (when you run the search yourself). Shows the loading row. |
| selectedOption | ComboboxOption | — | The picked option when it may not be in options (async search: its label before any search has run). |
| helperText | string | — | Hint under the field. Replaced by error when set. |
| description | string | — | The web name for helperText: help under the field. |
| error | string | — | Error under the field: red outline, and read out with the field. |
| invalid | boolean | — | Marks the field invalid without a message (red outline). |
| required | boolean | — | Adds "required" to the field's accessible hint. |
| disabled | boolean | — | — |
| readOnly | boolean | — | Shows the value; the sheet can't open. Stays focusable for screen readers. |
| size | FieldSize | 'lg' | — |
| style | StyleProp<ViewStyle> | — | — |