{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "combobox-demo",
  "title": "Combobox Demo",
  "description": "A worked example of Combobox: A field that narrows a list as you type, and holds one choice or several as removable chips.",
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/combobox.json"
  ],
  "files": [
    {
      "path": "components/demos/combobox-demo.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport {\n  Combobox,\n  type ComboboxOption,\n} from \"@/registry/default/combobox/combobox\"\n\nconst startingLabels: ComboboxOption[] = [\n  { value: \"bug\", label: \"Bug\", group: \"Kind\" },\n  { value: \"feature\", label: \"Feature\", group: \"Kind\" },\n  { value: \"chore\", label: \"Chore\", group: \"Kind\" },\n  { value: \"docs\", label: \"Docs\", group: \"Area\", keywords: [\"writing\"] },\n  { value: \"registry\", label: \"Registry\", group: \"Area\" },\n  {\n    value: \"accessibility\",\n    label: \"Accessibility\",\n    group: \"Area\",\n    keywords: [\"a11y\"],\n  },\n]\n\nexport function ComboboxDemo() {\n  const [options, setOptions] = React.useState(startingLabels)\n  const [labels, setLabels] = React.useState([\"bug\"])\n\n  return (\n    <div className=\"grid w-full max-w-md gap-3 pb-56\">\n      <Combobox\n        multiple\n        max={4}\n        label=\"Labels\"\n        placeholder=\"Search labels\"\n        options={options}\n        value={labels}\n        onValueChange={setLabels}\n        onCreate={(label) => {\n          const created = { value: label.toLowerCase(), label }\n          setOptions((current) => [...current, created])\n          setLabels((current) => [...current, created.value])\n        }}\n      />\n      <p className=\"text-muted-foreground text-xs\">\n        Four at most. Type to narrow the list, or add a label that is not on it\n        yet. Backspace on an empty field takes the last one back.\n      </p>\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}