Skip to content

An autocomplete text field with a filterable listbox (single value or multi-select chips), drawn as an inset Aqua search well with a translucent white menu and blue full-width highlight.

Installation

Requires the theme. Register the @skeuomorph namespace and add @skeuomorph/skeuomorph first, as shown in the installation guide. The CLI also pulls it in as a dependency.

pnpm dlx shadcn@latest add @skeuomorph/combobox

Without the namespace, install straight from the URL:

pnpm dlx shadcn@latest add https://ui-skeuomorph.vercel.app/r/combobox.json

Usage

import {
  Combobox,
  ComboboxContent,
  ComboboxEmpty,
  ComboboxInput,
  ComboboxItem,
  ComboboxList,
} from "@/components/ui/combobox"
const fonts = ["Lucida Grande", "Helvetica", "Geneva", "Monaco", "Optima"]
 
export function FontCombobox() {
  return (
    <Combobox items={fonts} defaultValue="Helvetica">
      <ComboboxInput placeholder="Font" aria-label="Font" showClear />
      <ComboboxContent>
        <ComboboxEmpty>No fonts found.</ComboboxEmpty>
        <ComboboxList>
          {(item: string) => (
            <ComboboxItem key={item} value={item}>
              {item}
            </ComboboxItem>
          )}
        </ComboboxList>
      </ComboboxContent>
    </Combobox>
  )
}

Multiple values

Pass multiple and render the selection as address tokens with ComboboxChips. Anchor the menu to the chips row with useComboboxAnchor.

API

ExportDescription
ComboboxRoot. Takes items, value / defaultValue, onValueChange and multiple.
ComboboxInputInset text well with the gel pull-down cap. showTrigger (default true) and showClear.
ComboboxContentThe translucent menu. Takes anchor to position against another element.
ComboboxList, ComboboxItemThe list and its rows. ComboboxList accepts a render function per item.
ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxCollectionGrouped lists.
ComboboxEmptyShown when the filter matches nothing.
ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxValueMulti-value tokens.
ComboboxTriggerStandalone pull-down trigger.
useComboboxAnchorRef for anchoring the menu to the chips row.

Composition

The examples below do not use combobox.tsx. They build a combobox from Popover and Command instead, which is handy when you want a button trigger or a searchable menu. Install them with npx shadcn@latest add @skeuomorph/popover @skeuomorph/command @skeuomorph/button.

Popover and Command

Status picker

Responsive