Combobox
An input combined with a filterable popup list, built on the Base UI Combobox primitive.
An input combined with a filterable popup list, built on the UI SDK Combobox component.
Installation
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
The UI SDK flavour is built on UI SDK Combobox, SevenUI Button and SevenUI Input Group. Its API is the SevenUI wrapper's, the same in both flavours: export names, props, data-slot values and the render prop, so code that uses only the SevenUI exports compiles against either flavour. What behaves differently, and any prop that is ignored or not supported, is listed below; code that imports a Base UI or third-party library directly needs changes. Switch to Base UI to read the prop tables, which describe that shared API in Base UI's terms.
Differences on UI SDK
- Popups open in the browser's top layer (the Popover API), rendered into
<body>as Base UI's are, with no Positioner element;side="inline-start"/"inline-end"map tostart/end. Callbackdetails.reasonstrings are UI SDK's (for exampletrigger-press,escape-key,outside-press). AninitialFocusorfinalFocusfunction receives"mouse"as its interaction, and one that returns nothing hands focus back to the trigger. - Filtered-out items stay mounted with
hidden. Base UI'sfilter(item, query),filter={null},itemToStringLabel/itemToStringValue,inputValue,loopFocusandonItemHighlightedmap to UI SDK's own filter, labels, query,loopand highlight. - After typing with a value selected, the first match stays highlighted, so Enter chooses it; Base UI highlights nothing until an arrow key.
id,inputRef,actionsRef,openOnInputClick,highlightItemOnHover,autoComplete,limit,locale,grid,virtualized,inlineandfilteredItemson the root are accepted and ignored.
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.