Design System Builder

Combobox

Combobox is a component component that provides combobox functionality.

Active

Installation

npm install @your-design-system/combobox
"use client"

import * as React from "react"
import { Combobox } from "@/components/ui/combobox"

const frameworks = [
  { value: "next.js", label: "Next.js" },
  { value: "sveltekit", label: "SvelteKit" },
  { value: "nuxt.js", label: "Nuxt.js" },
  { value: "remix", label: "Remix" },
  { value: "astro", label: "Astro" },
]

export function ComboboxDemo() {
  const [value, setValue] = React.useState("")

  return (
    <Combobox
      options={frameworks}
      value={value}
      onValueChange={setValue}
      placeholder="Select framework..."
      searchPlaceholder="Search frameworks..."
      emptyText="No framework found."
    />
  )
}

API Reference

PropTypeDefaultDescription
placeholderstringSelect option...

The placeholder prop for the component.

searchPlaceholderstringSearch...

The searchPlaceholder prop for the component.

emptyTextstringNo option found.

The emptyText prop for the component.

Styling

The component uses Tailwind CSS classes for styling. You can customize the appearance by overriding these classes.

Base Classes

w-[200px]

Design System Compliance

This component is validated against atomic design principles and foundation token usage.