ui

Combobox

An input combined with a list of predefined items to select. Built with Base UI and Tailwind CSS. Copy-paste ready.

API Reference

Installation

Usage

Single Selection

Multiple Selection

API Reference

The ComboboxInput component extends the original Base UI component with a few extra props:

Examples

Disabled

Use the disabled prop to prevent interaction. A defaultValue can still pre-populate the field.

Sizes

Use the size prop on ComboboxInput to render sm or lg variants alongside the default.

With Label

Pair ComboboxInput with a Label via useId to give the field an accessible name.

Auto Highlight

The autoHighlight prop pre-focuses the first matching option as the user types.

With Clear Button

Set showClear on ComboboxInput to render an ✕ button that resets the selection.

With Groups

Use ComboboxGroup, ComboboxGroupLabel, ComboboxCollection, and ComboboxSeparator to organise items into labelled sections.

Multiple Selection

Set multiple on Combobox and wrap the input with ComboboxChips to render each selected value as a removable chip.

With Search Icon

Pass any icon to the startAddon prop of ComboboxInput to decorate the leading edge of the field.

With Trigger Button

Render a ComboboxTrigger as a Button and move the search input inside ComboboxPopup for a select-style layout.

With Select Button

Use SelectButton as the trigger render target to match the visual style of a native select field with an inline popup search.

Form Integration

Place a combobox inside Form and Field to wire up label association, required validation, and a visible FieldError.

Form Integration - Multiple

Combine multiple selection with form validation to require at least one chip before the form can be submitted.

Debounce user input and fetch results on demand. A spinner replaces the search icon while the request is in flight.

Rich Item Rendering

Render custom JSX inside each ComboboxItem — here a coloured avatar, a name, and a role subtitle — for an assignee-style picker.

Controlled

Manage the selected value with external state via value and onValueChange, and drive a programmatic clear from a sibling button.

City Picker

A searchable city picker with timezone and country code shown as trailing metadata in each dropdown item, and the selected city's timezone displayed below.

Sprint Selector

A trigger-button combobox listing sprints with status badges (active, upcoming, completed) and date ranges. The selected sprint updates a preview badge in the trigger.

Font Picker

Items are grouped by category (Sans-serif, Serif, Monospace) with ComboboxGroup and ComboboxSeparator. Selecting a font renders a live preview sentence below in that typeface.

Timezone Picker

Displays the UTC offset as a badge inside the trigger and shows region and identifier details below the combobox on selection. A ghost clear button sits beside the trigger.

Currency Picker

Each option shows a symbol swatch, full currency name, and ISO code. The trigger reflects the chosen currency's symbol swatch and name, with a label below confirming the active currency.