- Docs
- Components
- Forms
Combobox
Pick from many by typing to filter: one value, or several as pills. It can ask a server.
- Import
- @qeetrix/react/experimental
- Status
- ExperimentalSince 0.0.6
- Renders
<input role="combobox">Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Playground
Every prop, live, and the code it takes.
import { Field } from "@qeetrix/react";
import { Combobox } from "@qeetrix/react/experimental";
<Field label="Owner">
<Combobox items={people} placeholder="e.g. Priya Sharma" />
</Field>02
Type to filter
A Select that narrows as you type: labels are matched, ignoring case and accents; values are IDs.
<Field label="Owner">
<Combobox items={people} icon={UserIcon} placeholder="e.g. Priya Sharma" />
</Field>03
Grouped
Options in groups, each with its heading.
<Field label="Policy">
<Combobox items={policies} placeholder="e.g. Two-step sign-in" />
</Field>04
Several
multiple: chosen values as pills. Backspace removes the last; the arrow keys reach the rest.
Priya Sharma
Rahul Verma
<Field label="Reviewers">
<Combobox items={people} multiple defaultValue={["usr_1", "usr_3"]} placeholder="e.g. Priya Sharma" />
</Field>05
Searching on the server
onSearch runs when typing pauses, and shows the results as given; loading says "Searching…".
const { data, isFetching } = useDirectory(query);
<Field label="Owner">
<Combobox items={data ?? []} onSearch={setQuery} loading={isFetching} placeholder="e.g. Priya Sharma" />
</Field>