Appica UIUI 1.0.0

Combobox

An input with a dropdown list for picking one option or several.

Usage

Combobox is a compound component. The root holds the data (items) and shared options (size, variant, clearable, icon, multiple, grid); the parts compose the input and the filtered popup:

  • ComboboxInput — the text field, styled like Input. It filters the list as you type. Add adornments with startSlot / endSlot.
  • ComboboxTrigger / ComboboxValue — a select-style trigger (also styled like Input) that shows the current value and opens the popup. Use it instead of ComboboxInput when the search field should live inside the popup (see Country select).
  • ComboboxChips / ComboboxChip — a chip-based input for multiple selection, in place of ComboboxInput.
  • ComboboxContent — the portalled, auto-positioned popup. Accepts the shared floating props.
  • ComboboxList — the scrollable list. Pass a render function over the filtered items, or static ComboboxItems.
  • ComboboxItem — one option; its value is what selection reports.
  • ComboboxEmpty — shown only when the filter matches nothing.

Combobox and Autocomplete are siblings built on the same Base UI primitive. Reach for Combobox when you're picking a value from a set (its chevron, clearable, chips, and grid lean toward selection); use Autocomplete for a leaner typeahead. For a short, known list with no search, use a Select.

Examples

Variants

variant switches the input appearance between a bordered outline (default) and a filled soft field.

Sizes

size on the root scales the input, popup radius, and items together — sm, md (default), or lg.

Clearable & chevron

icon (a chevron that toggles the popup) is on by default; turn it off with icon={false}. Set clearable to add a clear (✕) button once there's a value. Both render inside the input.

Disabled & error states

disabled on the root greys out the input and blocks interaction. Set aria-invalid on the ComboboxInput to paint the error state — it's mirrored to data-invalid. Inside a Field, the input also inherits the field's disabled and invalid state, which is the better choice when you're rendering a validation message.

Start & end slots

ComboboxInput accepts startSlot and endSlot for adornments inside the input frame — a search icon, a shortcut hint, a unit — laid out around the field and its controls.

Country select

A searchable country picker with flags. When items are objects, give the root an itemToStringLabel so the input and filter know how to read each one; here the selected country's flag is mirrored into the input through startSlot. The list is long, so its ComboboxList is wrapped in a ScrollArea for a custom, themeable scrollbar (set overflow-y-visible on the list so the ScrollArea owns the scroll).

Input inside popup and custom scroll

For a select-style picker, render a ComboboxTrigger (showing the current ComboboxValue) as the field and move the search ComboboxInput inside ComboboxContent. Set icon={false} on the root so the in-popup input drops its own chevron — the trigger already has one. As with Country select, the long list is wrapped in a ScrollArea for a custom scrollbar.

User select

Rich items with an Avatar, a name, and a trailing role — search a directory and assign a person. The chosen avatar is echoed back into the input via startSlot.

Grouped options

Pass a grouped items array — { value, items }[] — and render each group with ComboboxGroup + ComboboxLabel + ComboboxCollection. The outer render function iterates groups; ComboboxCollection renders the items inside each. As with Country select, this longer list wraps its ComboboxList in a ScrollArea for a custom scrollbar.

Grid layout

Set grid on the root to lay options out in a grid — arrow keys then move in two dimensions. ComboboxList's cols controls how many items per row (defaults to 2 in grid mode); give each item flex-1 to fill its cell.

Multiple selection

Set multiple and swap ComboboxInput for ComboboxChips: each selected value becomes a removable ComboboxChip, with the text field inline for adding more. The value is an array.

Creatable

Let users add an option that isn't in the list. Control the items, value, and inputValue yourself: when the typed query has no exact match, append a synthetic "create" item, and in onValueChange detect it to add the new entry to your data and select it. Here each created label is added to a multi-select chip field.

Controlled

Drive the selection yourself with value + onValueChange. The input's text is managed separately — control it too with inputValue + onInputValueChange when you need to.

RTL

Every Appica UI component supports right-to-left layouts out of the box. Set the dir attribute on a container (commonly your <html> element) so CSS logical properties resolve correctly, and wrap your tree in DirectionProvider so direction-aware behavior — roving focus, popup placement, and the like — follows the same direction.

For setup details and caveats, see the RTL guide.

API reference

Combobox wraps Base UI's Combobox. Each part forwards every remaining prop to the matching Base UI primitive, so anything it accepts works here — the tables below list the Appica additions and the most common props. See the Base UI docs for the complete API.

Combobox

The root. Holds the data and the shared styling/behavior options; renders no DOM of its own.

ComboboxInput

The text field. Renders Base UI's Input inside an InputGroup, styled like Input.

Also forwards every native <input> prop (onChange, name, aria-*, ref, …).

ComboboxTrigger

A select-style trigger button (styled like Input) that shows the value via ComboboxValue and opens the popup. Use it — instead of ComboboxInput as the field — when the search input should live inside ComboboxContent.

Also forwards every native <button> prop (onClick, disabled, aria-*, ref, …).

ComboboxChips

The chip-based input for multiple selection — render it instead of ComboboxInput.

ComboboxChip

One removable chip representing a selected value.

ComboboxContent

The portalled, auto-positioned popup wrapping the list. Accepts the shared floating props.

ComboboxList

The scrollable list container.

ComboboxItem

One option in the list.

ComboboxEmpty

Shown only when the filter matches nothing — otherwise it renders nothing.

ComboboxGroup

Wraps one section of a grouped list. Pass the section's items so a nested ComboboxCollection can render them, and label it with a ComboboxLabel.

ComboboxLabel

The visible heading for a ComboboxGroup.

ComboboxCollection

Renders the items of the enclosing ComboboxGroup from a render function.

ComboboxValue

Renders the current value — typically a function child mapping the selected value(s) to chips or text.

ComboboxSeparator

A thin divider between sections.

Accessibility

  • The input has role="combobox"; the popup is a listbox (or grid when grid is set) and items are option/gridcell. Selection and active state are wired through aria-activedescendant.
  • ↑/↓ move the highlight, Enter selects, Escape closes the popup, and typing filters the list. In multiple mode, Backspace in an empty field removes the last chip.
  • The clear and chevron buttons have aria-labels (Clear selection, Toggle popup) and become disabled when the input is disabled; chip remove buttons are labelled Remove.
  • Always give ComboboxInput (or ComboboxChips) a visible label or an aria-label.
  • aria-invalid on the input is bridged to data-invalid so the error state styles with or without a wrapping Field.
  • Popup enter/exit transitions are skipped when the user prefers reduced motion.

© 2026 Appica UI. A free component library, crafted by the Appica team.