Combobox
Examples
Loading examples…
API
From COMPONENTS.md.
import { Combobox } from 'achery-ui'
// Fixed options
<Combobox
value={tags}
onChange={setTags}
options={['computer', 'outside', 'quick-win']}
placeholder="Add tags…"
/>
// Free-text + suggestions
<Combobox
value={contextTags}
onChange={setContextTags}
options={knownTags}
allowCustom
placeholder="Add context tags…"
/>
// With Field wrapper
<Field label="Context">
<Combobox value={selected} onChange={setSelected} options={opts} allowCustom />
</Field>
| Prop | Type | Default | Notes |
|---|---|---|---|
value |
string[] |
— | Controlled selected values |
onChange |
(v: string[]) => void |
— | |
options |
string[] |
[] |
Suggested values shown in dropdown |
allowCustom |
boolean |
false |
Let user type values not in options |
placeholder |
string |
— | Shown when no values selected |
disabled |
boolean |
— | |
error |
boolean |
— | Applies danger border |
className |
string |
— |
Keyboard: ↑↓ navigate options, Enter/comma confirm, Backspace removes last chip, Escape closes.
Single-select variant of Combobox. Selected value is shown directly in the input (no chips). Backspace/Delete when empty clears the selection.
import { SingleCombobox } from 'achery-ui'
<SingleCombobox
value={category}
onChange={setCategory}
options={['Subscriptions', 'Utilities', 'Groceries']}
placeholder="Select a category…"
/>
// Free-text allowed
<SingleCombobox value={val} onChange={setVal} options={opts} allowCustom />
| Prop | Type | Default | Notes |
|---|---|---|---|
value |
string | null |
— | Controlled selected value |
onChange |
(v: string | null) => void |
— | |
options |
string[] |
[] |
Suggested values |
allowCustom |
boolean |
false |
Accept typed values not in options |
placeholder |
string |
— | |
disabled |
boolean |
— | |
error |
boolean |
— | Applies danger border |
className |
string |
— |
Keyboard: ↑↓ navigate, Enter selects, Backspace/Delete clears, Escape closes.