Skip to content
SevenUI
Sign in
On this page

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.

PropTypeDefault
itemsitem array (or { label, value }[])—
value / defaultValueitem (array when multiple)—
onValueChange(value) => void—
multiplebooleanfalse
disabled / required / readOnlybooleanfalse

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.

PropTypeDefault
side / alignpositioner placement"bottom" / "start"
sideOffset / alignOffsetnumber6 / 0
anchorelement ref to anchor totrigger

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)TypeDefault
showRemovebooleantrue

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.

Was this page helpful?