mirror of
https://github.com/cosscom/coss.git
synced 2026-09-14 20:06:50 +08:00
16 lines
1.5 KiB
JSON
16 lines
1.5 KiB
JSON
{
|
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
"name": "combobox-lg",
|
|
"type": "registry:example",
|
|
"description": "Large combobox",
|
|
"registryDependencies": ["@coss/combobox"],
|
|
"files": [
|
|
{
|
|
"path": "registry/default/examples/combobox-lg.tsx",
|
|
"content": "\"use client\"\n\nimport {\n Combobox,\n ComboboxEmpty,\n ComboboxInput,\n ComboboxItem,\n ComboboxList,\n ComboboxPopup,\n} from \"@/registry/default/ui/combobox\"\n\nconst items = [\n { value: \"apple\", label: \"Apple\" },\n { value: \"banana\", label: \"Banana\" },\n { value: \"orange\", label: \"Orange\" },\n { value: \"grape\", label: \"Grape\" },\n { value: \"strawberry\", label: \"Strawberry\" },\n { value: \"mango\", label: \"Mango\" },\n { value: \"pineapple\", label: \"Pineapple\" },\n { value: \"kiwi\", label: \"Kiwi\" },\n { value: \"peach\", label: \"Peach\" },\n { value: \"pear\", label: \"Pear\" },\n]\n\nexport default function ComboboxLg() {\n return (\n <Combobox items={items}>\n <ComboboxInput\n size=\"lg\"\n placeholder=\"Select an item...\"\n aria-label=\"Select an item\"\n />\n <ComboboxPopup>\n <ComboboxEmpty>No results found.</ComboboxEmpty>\n <ComboboxList>\n {(item) => (\n <ComboboxItem key={item.value} value={item}>\n {item.label}\n </ComboboxItem>\n )}\n </ComboboxList>\n </ComboboxPopup>\n </Combobox>\n )\n}\n",
|
|
"type": "registry:example"
|
|
}
|
|
],
|
|
"categories": ["combobox", "input"]
|
|
}
|