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
| Prop | Type | Default | Description |
|---|---|---|---|
placeholder | string | Select option... | The placeholder prop for the component. |
searchPlaceholder | string | Search... | The searchPlaceholder prop for the component. |
emptyText | string | No 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.
✓ Atomic Design Compliant
This component follows atomic design principles and properly uses foundation tokens.
On This Page