Combobox
An input combined with a filterable popup list, built on the Base UI Combobox primitive.
Installation
Bash
Usage
Examples
Multiple with chips
Selected items render as removable chips inside ComboboxChips. Anchor
the popup to the chips container with useComboboxAnchor:
ref={anchor} on the chips, anchor={anchor} on the content.
API reference
Combobox
Extends the Base UI Combobox Root — all its props apply.
| Prop | Type | Default |
|---|---|---|
items | item array (or { label, value }[]) | — |
value / defaultValue | item (array when multiple) | — |
onValueChange | (value) => void | — |
multiple | boolean | false |
disabled / required / readOnly | boolean | false |
items drives the automatic filtering as the user types and lets
ComboboxEmpty know when nothing matches.
ComboboxList
Takes a function child — (item) => ReactElement — called once per
item currently matching the input value; return a ComboboxItem for
each, so filtering re-renders the list automatically.
ComboboxInput
Renders the Combobox.InputGroup → Combobox.Input pair, with
ComboboxClear and ComboboxTrigger positioned inside the group as
inline controls. Its className styles the field container — size the
field with it (e.g. className="w-64").
ComboboxContent
Renders through Combobox.Portal → Combobox.Positioner →
Combobox.Popup, mirroring Select.
| Prop | Type | Default |
|---|---|---|
side / align | positioner placement | "bottom" / "start" |
sideOffset / alignOffset | number | 6 / 0 |
anchor | element ref to anchor to | trigger |
ComboboxChips, ComboboxChip, ComboboxChipsInput
Multi-select chips: ComboboxChips is the bordered container (attach
the useComboboxAnchor ref here), ComboboxChip renders one selected
item with a built-in remove button, and ComboboxChipsInput is the
inline filter input.
Prop (ComboboxChip) | Type | Default |
|---|---|---|
showRemove | boolean | true |
ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxValue, ComboboxTrigger
Styled Base UI parts. useComboboxAnchor() is exported as a convenience
ref hook for the chips anchoring pattern.