Components
Loading preview...
Filters large lists to selectable options based on the matching query.
@shugar
npx shadcn@latest add https://21st.dev/r/shugar/comboboximport { useState } from "react";
import { Combobox } from "@/components/ui/combobox";
export default function ControlledDemo() {
const [value, setValue] = useState<string | null>("b");
return (
<div className="w-3/4">
<Combobox onChange={setValue} placeholder="Search..." value={value}>
<Combobox.Input />
<Combobox.List>
<Combobox.Option value="a">One</Combobox.Option>
<Combobox.Option value="b">Two</Combobox.Option>
<Combobox.Option value="c">Three</Combobox.Option>
</Combobox.List>
</Combobox>
</div>
);
}