Combobox
An input that suggests matching options as the user types.
- Status
- ReadyBuild day 17 of 21
- Code
- In React
- Role
- Form
Usage
This demo is live, and the code below it is the same code, imports included. The component lives in src/ui of this repository and is not published to npm yet.
Type at least 3 characters
Pastes as editable layers. Shadows are not exported.
import { useState } from "react";
import { Combobox, type ComboboxOption } from "@/ui";
const banks: ComboboxOption[] = [
{ value: "bri", label: "Bank Rakyat Indonesia" },
{ value: "bni", label: "Bank Negara Indonesia" },
];
export default function ComboboxDemo() {
const [bank, setBank] = useState<string | null>(null);
return <Combobox label="Destination bank" options={banks} value={bank} onChange={setBank} />;
}Variants and states
Every specimen is the real component from src/ui, held in one state.
Choose a bank
Choose at most two
Pastes as editable layers. Shadows are not exported.
Props
- label
- string · default none
- Required.
- options
- { value, label }[] · default none
- Required.
- mode
- "single" | "multiple" · default "single"
- Multiple shows picks as chips.
- value, onChange
- string | null, or string[] · default none
- Controlled.
- placeholder
- string · default none
- hint, error
- string · default none
- emptyText
- string · default "No results"
- Shown when nothing matches.
- disabled
- boolean · default none
Figma to code
Figma properties by their exact names from Naming, and the React prop that carries each one. The table covers the shared properties that bear on this component; the Figma file decides which of them its component exposes. None means there is no prop for it yet.
- 🔀 Mode
- mode
- single or multiple.
- 🎯 State
- error, disabled
- Hover and focus come from the browser.
- Label, Helper Text, Placeholder
- label, hint, placeholder
- Same.
Accessibility
What the code in src/ui does today, and what it leaves to you.
Keyboard
- Typing filters. Down opens and moves, Up moves, Enter picks, Escape closes. In multiple mode, Backspace in an empty field removes the last pick.
Screen readers
- The ARIA combobox pattern: role=combobox with aria-expanded and aria-activedescendant, and a role=listbox of options.
What you still need to do
- For a short fixed list, use Select. Show an Empty State when nothing matches.
When to use
Long option lists such as banks, cities, or countries.
Do and don't
Do
- Match anywhere in the option name, not only the start.
- Support arrow keys and Enter to pick an option.
Don't
- Use for fewer than about ten options: use a select or radio group.
- Accept free text when only listed values are valid.
Related
4 of 28 other molecules, same role and ready ones first.
- Amount InputAn input for money that formats the value as the user types.Ready
- Date PickerChooses a date from a calendar or by typing.Ready
- File InputLets people choose or drop a file to upload.Ready
- InputA field for entering short text, numbers, or other data.Ready
Status reflects the component tracker snapshot of 29 October 2026.