Combobox

ARIA
RTL

An input that behaves similarly to a select, with the addition of a free text input to filter options.

Based on Headless UI.

Combobox

Anatomy

<Combobox>
  <Combobox.Trigger>...</Combobox.Trigger>
  <Combobox.Options>
    <Combobox.Option>...</Combobox.Option>
  </Combobox.Options>
  <Combobox.Hint>...</Combobox.Hint>
</Combobox>

Default / Nullable

Anatomy

<Combobox>
  <Combobox.Select>...</Combobox.Select>
  <Combobox.Options>
    <Combobox.Option>...</Combobox.Option>
  </Combobox.Options>
  <Combobox.Hint>...</Combobox.Hint>
</Combobox>

Select

Different states for Select

Anatomy

<Combobox>
  <Combobox.InsetSelect>...</Combobox.InsetSelect>
  <Combobox.Options>
    <Combobox.Option>...</Combobox.Option>
  </Combobox.Options>
  <Combobox.Hint>...</Combobox.Hint>
</Combobox>

Select with inner label

Different states for Select with inner label

Anatomy

<Combobox>
  <Combobox.MultiSelect>...</Combobox.MultiSelect>
  <Combobox.Options>
    <Combobox.Option>...</Combobox.Option>
  </Combobox.Options>
  <Combobox.Hint>...</Combobox.Hint>
</Combobox>

MultiSelect

MultiSelect with "Select all" option

Anatomy

<Combobox>
  <Combobox.InsetMultiSelect>...</Combobox.InsetMultiSelect>
  <Combobox.Options>
    <Combobox.Option>...</Combobox.Option>
  </Combobox.Options>
  <Combobox.Hint>...</Combobox.Hint>
</Combobox>

MultiSelect with inner label

Anatomy

<Combobox>
  <Combobox.VisualMultiSelect>...</Combobox.VisualMultiSelect>
  <Combobox.Options>
    <Combobox.Option>...</Combobox.Option>
  </Combobox.Options>
  <Combobox.Hint>...</Combobox.Hint>
</Combobox>

VisualMultiSelect

Alignment of controls for options with long names

Combobox

NameTypeRequiredDefaultDescription
valueunknownYes-The selected value.
onChange(value: unknown) => voidYes-The function to call when a new option is selected.
onQueryChange(value: string) => voidYes-The function to call when the filter query is changing.
onClear(index?: number | string) => voidNo-The function to call when the selected options at MultiSelect Combobox type are being cleared.
isErrorbooleanNo-Set valid/non-valid
disabledbooleanNo-Set disabled/non-disabled
sizesm | md | lg | xl | stringNomdSize
classNamestringNo-Tailwind classes for custom styles.
positiontop-start | top-end | bottom-start | bottom-end | right-start | right-end | left-start| left-end | top | bottom | right| leftNobottomSet placement for combobox
Render Props:
openbooleanNo-Whether or not the Listbox is open.
multiplebooleanNo-Whether multiple options can be selected or not.
nullablebooleanNo-Whether the selected value can be cleared or not.

Combobox.Trigger

NameTypeRequiredDefaultDescription
classNamestringNo-Tailwind classes for custom styles.
onClose(value: unknown) => void;No-Called when the Combobox is dismissed.

Combobox.Input | Combobox.InsetInput | Combobox.VisualSelectInput

NameTypeRequiredDefaultDescription
onChange(value: unknown) => voidYes-The function to call when a new option is selected.
onQueryChange(value: string) => voidYes-The function to call when the query filter is changing.
displayValue(value: unknown) => stringNo-The value of the selected option to display.
labelstring | undefinedNo-Inset label title (for InsetInput)
placeholderstring | undefinedNo-Placeholder
typetext | string | number | date | time | date-time-local | undefinedNotextType of the input field
classNamestringNo-Tailwind classes for custom styles.

Combobox.Button

NameTypeRequiredDefaultDescription
classNamestringNo-Tailwind classes for custom styles.
Render Props:
openbooleanNo-Whether or not the Listbox is open.

Combobox.Options

NameTypeRequiredDefaultDescription
menuWidthstringNo-Tailwind class for custom options container width.
classNamestringNo-Tailwind classes for custom styles.

Combobox.Option

NameTypeRequiredDefaultDescription
valueunknownNo-The option value.
Render Props:
activebooleanNo-Whether or not the option is the active/focused option.
selectedbooleanNo-Whether or not the option is the selected option.

Combobox.Transition

NameTypeRequiredDefaultDescription
onQueryChange(value: string) => voidYes-The same function that is set in the Combobox component.

Combobox.Select | Combobox.InsetSelect

NameTypeRequiredDefaultDescription
onChange(value: unknown) => voidYes-The function to call when a new option is selected.
onQueryChange(value: string) => voidYes-The function to call when the query filter is changing.
displayValue(value: unknown) => stringNo-The value of the selected option to display.
labelJSX.Element | stringNo-Label title | Inset label title
placeholderJSX.Element | stringNo-Placeholder
classNamestringNo-Tailwind classes for custom styles.
Render Props:
openbooleanNo-Whether or not the Listbox is open.
onClose(value: unknown) => void;No-Called when the Combobox is dismissed.

Combobox.MultiSelect | Combobox.InsetMultiSelect | Combobox.VisualMultiSelect

NameTypeRequiredDefaultDescription
onChange(value: unknown) => voidYes-The function to call when a new option is selected.
onQueryChange(value: string) => voidYes-The function to call when the query filter is changing.
displayValue(value: unknown) => stringNo-The value of the selected option to display.
labelJSX.Element | stringNo-Label title | Inset label title
placeholderJSX.Element | stringNo-Placeholder
classNamestringNo-Tailwind classes for custom styles.
counterNumberNo0Number of selected options
Render Props:
openbooleanNo-Whether or not the Listbox is open.
onClose(value: unknown) => void;No-Called when the Combobox is dismissed.

Combobox.VisualMultiSelect

NameTypeRequiredDefaultDescription
forceUpdatebooleanNo-If you need to align the list of options properly on each select/deselect set the "boolean" property.

Combobox.Counter

NameTypeRequiredDefaultDescription
counternumberYes-Number of selected options
classNamestringNo-Tailwind classes for custom styles.
Render Props:
openbooleanNo-Whether or not the Listbox is open.

Combobox.SelectedItem

NameTypeRequiredDefaultDescription
indexnumber | stringYes-Index of the selected item
labelnumber | stringYes-Displayed label of the selected item
classNamestringNo-Tailwind classes for custom styles.
Render Props:
openbooleanNo-Whether or not the Listbox is open.

Combobox.Hint

NameTypeRequiredDefaultDescription
classNamestringNo-Tailwind classes for custom styles.