Combobox

An input that filters a list of options as you type. Built on Base UI's combobox primitive, so filtering, keyboard navigation, and ARIA wiring come for free. Looking for a ready-made province & city picker? See City Selector.

Last updated August 6, 2026

Overview

Examples

Multiple selection

Groups

Clear button

Disabled

Installation

$ npx shadcn@latest add @persianlabsui/combobox

Usage

import {
  Combobox,
  ComboboxContent,
  ComboboxEmpty,
  ComboboxIcon,
  ComboboxInput,
  ComboboxInputGroup,
  ComboboxItem,
  ComboboxList,
} from "@/components/ui/combobox"
 
const frameworks = ["Next.js", "SvelteKit", "Nuxt.js", "Remix", "Astro"]
 
export function Example() {
  return (
    <Combobox items={frameworks}>
      <ComboboxInputGroup>
        <ComboboxInput placeholder="Select a framework" />
        <ComboboxIcon />
      </ComboboxInputGroup>
      <ComboboxContent>
        <ComboboxEmpty>No frameworks found.</ComboboxEmpty>
        <ComboboxList>
          {(item) => <ComboboxItem key={item} value={item}>{item}</ComboboxItem>}
        </ComboboxList>
      </ComboboxContent>
    </Combobox>
  )
}

API Reference

Combobox

PropTypeDefaultDescription
itemsValue[]undefinedA flat array of items, or an array of groups with items.
valueValueundefinedThe selected value. Use when controlled.
defaultValueValueundefinedThe initially selected value when uncontrolled.
onValueChange(value, details) => voidCalled when the selected value changes.
multiplebooleanfalseWhether multiple items can be selected.
disabledbooleanfalsePrevents interaction with the combobox.
readOnlybooleanfalsePrevents choosing a different option from the popup.
itemToStringLabel(item: Value) => stringundefinedConverts an object item value to a display string. Not needed when items are already strings.
filter(item, query, itemToString?) => booleanbuilt-inCustom filter function used to match items against the input query.
autoHighlightbooleanfalseHighlights the first matching item automatically while filtering.

ComboboxInput

PropTypeDefaultDescription
placeholderstringundefinedPlaceholder text shown when the input is empty.

ComboboxItem

PropTypeDefaultDescription
valueValuerequiredThe value associated with this item.
disabledbooleanfalsePrevents selection of this item.

ComboboxContent

PropTypeDefaultDescription
sideOffsetnumber6Distance in pixels between the anchor and the popup.