Components / Choice
Combobox
Autocomplete input: local or async (debounced, abortable) suggestions, optional free text.
@ruckc/truss-ui Choice
Import
import { Combobox } from '@ruckc/truss-ui'; Playground
value
API
| Prop | Type | Default | Description |
|---|---|---|---|
options | Option[] | [] | The choices to offer. |
loadOptions | (query: string, signal: AbortSignal) => Promise<Option[]> | — | Async source (server search). Receives the query and an AbortSignal for stale requests. |
value bindable | string | — | The current value. Bind it with `bind:value`. |
label | string | — | Visible label shown above the control. |
ariaLabel | string | — | Accessible name when no visible `label` is shown. |
placeholder | string | 'Type to search…' | Hint shown while the field is empty. |
allowCustom | boolean | false | Accept free text as the value when nothing is picked. |
disabled | boolean | false | Disables the control: it cannot be focused, changed or activated. |
error | string | — | Error message. Marks the control invalid, replaces the hint, and is announced to assistive technology. |
debounce | number | 200 | Milliseconds to wait after typing before querying `loadOptions`. |