crysta1221

Combobox

Component

About

A searchable text input with a filterable dropdown list of options, supporting single or multiple selection shown as removable chips.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Combobox to your project and fits it to your theme.

Code

How Combobox is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import {
  Combobox,
  ComboboxContent,
  ComboboxEmpty,
  ComboboxInput,
  ComboboxItem,
  ComboboxList,
} from "@/components/ui/combobox";

const frameworks = ["Next.js", "SvelteKit", "Nuxt", "Remix", "Astro"];

export default function Demo() {
  return (
    <Combobox items={frameworks}>
      <ComboboxInput
        aria-label="Framework"
        placeholder="Select a framework"
        className="w-full max-w-64"
      />
      <ComboboxContent>
        <ComboboxEmpty>No items found.</ComboboxEmpty>
        <ComboboxList>
          {(item) => (
            <ComboboxItem key={item} value={item}>
              {item}
            </ComboboxItem>
          )}
        </ComboboxList>
      </ComboboxContent>
    </Combobox>
  );
}

Dependencies

More by crysta1221

View all
  • M3 Expressive Button

    M3 Expressive Button

    21
  • Attachment

    Attachment

    21
  • Circular Progress

    Circular Progress

    1
  • Input OTP

    Input OTP

  • Field

    Field

  • List Item

    List Item

  • Empty

    Empty