Zephora UI

Form

Combobox

Autocomplete text input following the ARIA combobox (list) pattern, with filtering, a custom filter predicate, free-text mode and an optional clear button.

Import

import { Combobox } from "@zephora/react";

Examples

Basic

Type to filter; the default filter is a case-insensitive contains.

Controlled with clear

Value: (none)

Free text (freeSolo)

`freeSolo` lets Enter commit text that matches no option.

Async search

`filterMode="none"` renders the options exactly as given (your code filters server-side); `loading` shows a spinner row while a request is in flight. This demo simulates a 400 ms request.

API

Combobox props

PropTypeDefaultDescription
options *ComboboxOption[]Options offered in the listbox. Same shape as SelectOption (label, value, disabled?, icon?, description?, group?, textValue?).
valuestringControlled selected value ("" = nothing selected).
defaultValuestringInitial selected value in uncontrolled mode.
onValueChange(value: string) => voidCalled with the newly selected value.
inputValuestringControlled text-field value.
onInputChange(inputValue: string) => voidCalled on every text-field change.
filterFn(option, inputValue) => booleancase-insensitive containsFilter predicate applied to the options.
filterMode"client" | "none""client""client" filters options against the input text; "none" renders options as-is (server-side/async search — the parent filters).
freeSolobooleanfalseAllows committing free text (Enter) as the value.
placeholderstringInput placeholder text.
size"sm" | "md" | "lg""md"Input scale.
invalidbooleanfalseMarks the input invalid (aria-invalid).
disabledbooleanfalseDisables the input.
clearablebooleanfalseShows a clear button when there is text or a selection.
loadingbooleanfalseShows a spinner row in the popup and sets aria-busy on the listbox.
renderOption(option: ComboboxOption, state: { selected, active }) => ReactNodeCustom option renderer — replaces the default icon/label/description layout.
unstyledbooleanfalseHeadless mode — drops Zephora classes so your own CSS can style it.
…restHTMLAttributes<HTMLDivElement>Forwarded to the root wrapper element.

Keyboard

KeyAction
TypeFilters the options and opens the listbox.
Arrow Down / Arrow UpOpens the list or moves the active option.
EnterSelects the active option (or commits free text with freeSolo).
EscapeCloses the listbox.
TabCloses the listbox and moves focus.