Skip to contentKino
Skip to Content

Combobox

An input that filters a list as you type, for one value, many as chips, or a button whose list has its own search.

npx shadcn add https://kinoui.com/r/combobox.json
Share on

Examples

Assignee

Default

Type to filter, and Enter picks the first match. As you type, the list moves to the height of what still matches.

Labels

Multiple

With multiple, each value is a chip. Backspace in the empty input removes the last one.

Time zone

Groups

Pass groups as items, each with its own items; a long list scrolls.

Project

Search in the list

Give ComboboxTrigger children for a button that shows the value, and put the input in ComboboxContent.

Reviewer

From a server

Set filter to null and pass the results as items. Once a search lasts, a spinner shows: in the list while it is empty, in the field while older results still show. ComboboxStatus tells a screen reader how many it found.

Pick who owns this incident.

In a form

In a Field, its label names the input and an invalid field marks it, with the error under it.

Installation

npx shadcn@latest add https://kinoui.com/r/combobox.json
Files
lib/reduce-motion.tslib/scroll.tslib/refs.tslib/resize.tslib/swap.tsxlib/popup.tslib/glide.tsxcomponents/kino/tooltip.tsxlib/cut.tsxcomponents/kino/input.tsxcomponents/kino/label.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxcomponents/kino/separator.tsxlib/run-progress.tslib/highlight.tslib/menu.tsxcomponents/kino/select.tsxlib/filter-list.tsxlib/chip.tsxlib/flow.tscomponents/kino/combobox.tsx
Packages
@base-ui/reactclass-variance-authority

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

Combobox

PropTypeDefaultDescription
itemsValue[]{ value, items }[]NoneThe options, or groups of them; the list renders the ones that match.
defaultValueValueValue[]nullNoneThe value at first, when you leave the state to the combobox.
valueValueValue[]nullNoneThe value, when you hold the state.
onValueChange(value, details) => voidNoneCalled when the value changes.
onInputValueChange(text, details) => voidNoneCalled as the typed text changes.
multiplebooleanfalseLets more than one option be picked; the value is then an array.
autoHighlightbooleantrueHighlights the first match as you type, so Enter picks it. Set it to false to leave the highlight to the arrow keys.
filterfunctionnullNoneHow an option matches what is typed. null shows items as they are, for results from a server.

ComboboxChipRemove

PropTypeDefaultDescription
labelledBystringNoneThe id of the chip’s label, so the button reads “Remove Bug”.

ComboboxContent

PropTypeDefaultDescription
side'left''top''bottom''right''inline-start''inline-end''bottom'The side of the field it opens on.
align'start''center''end''start'How it lines up with the field along that side.
sideOffsetnumberfunction6The gap between it and the field, in pixels.
alignOffsetnumberfunction0How far it shifts along that side, in pixels.
anchorElementRefObjectfunctionNoneWhat it opens under, when not the field or the chips.
classNamestringNoneGoes to the content inside the box.

ComboboxItem

PropTypeDefaultDescription
indicatorbooleantrueKeeps room for the tick. Turn it off in a list that never shows a picked option.

Accessibility

  • The input is a combobox and the list a listbox: arrow keys move the highlight, Enter picks, and Escape closes the list.
  • Escape on a closed combobox clears its value, as the WAI-ARIA pattern allows.
  • Name it with a Field and its label, ComboboxLabel, or aria-label. With the input in the list, give ComboboxContent an aria-label too.
  • Each chip’s remove button is named after its chip, and a chip says it can be removed with Backspace or Delete.
  • The picked option has a tick as well as a highlight, so its state never relies on colour.
  • When the system asks for less motion, the list changes height at once and only fades.