{
"$schema": "https://blode.co/ui/schema/registry-item.json",
"name": "combobox",
"title": "Combobox",
"author": "Matthew Blode",
"description": "An autocomplete input that combines a text field with a filterable dropdown list.",
"dependencies": ["@base-ui/react", "blode-icons-react"],
"registryDependencies": ["button", "input-group"],
"files": [
{
"path": "ui/combobox.tsx",
"content": "\"use client\";\n\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react\";\nimport { CheckIcon, ChevronDownIcon, CrossSmallIcon, XIcon } from \"blode-icons-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"@/components/ui/input-group\";\n\nconst Combobox = ComboboxPrimitive.Root;\n\nconst ComboboxValue = ({ ...props }: ComboboxPrimitive.Value.Props) => (\n \n);\n\nconst ComboboxTrigger = ({\n className,\n children,\n render,\n ...props\n}: ComboboxPrimitive.Trigger.Props) => (\n \n }\n {...props}\n >\n {children}\n \n \n);\n\nconst ComboboxClear = ({ className, ...props }: ComboboxPrimitive.Clear.Props) => (\n }\n {...props}\n >\n \n \n);\n\nconst ComboboxInput = ({\n className,\n children,\n disabled = false,\n showTrigger = true,\n showClear = false,\n ...props\n}: ComboboxPrimitive.Input.Props & {\n showTrigger?: boolean;\n showClear?: boolean;\n}) => (\n \n } {...props} />\n \n {showTrigger && (\n \n )}\n {showClear && }\n \n {children}\n \n);\n\nconst ComboboxContent = ({\n className,\n side = \"bottom\",\n sideOffset = 6,\n align = \"start\",\n alignOffset = 0,\n anchor,\n ...props\n}: ComboboxPrimitive.Popup.Props &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n \"side\" | \"align\" | \"sideOffset\" | \"alignOffset\" | \"anchor\"\n >) => (\n \n \n \n \n \n);\n\nconst ComboboxList = ({ className, ...props }: ComboboxPrimitive.List.Props) => (\n \n);\n\nconst ComboboxItem = ({ className, children, ...props }: ComboboxPrimitive.Item.Props) => (\n \n {children}\n \n }\n >\n \n \n \n);\n\nconst ComboboxGroup = ({ className, ...props }: ComboboxPrimitive.Group.Props) => (\n \n);\n\nconst ComboboxLabel = ({ className, ...props }: ComboboxPrimitive.GroupLabel.Props) => (\n \n);\n\nconst ComboboxCollection = ({ ...props }: ComboboxPrimitive.Collection.Props) => (\n \n);\n\nconst ComboboxEmpty = ({ className, ...props }: ComboboxPrimitive.Empty.Props) => (\n \n);\n\nconst ComboboxSeparator = ({ className, ...props }: ComboboxPrimitive.Separator.Props) => (\n \n);\n\nconst ComboboxChips = ({ className, ...props }: ComboboxPrimitive.Chips.Props) => (\n \n);\n\nconst ComboboxChip = ({\n className,\n children,\n showRemove = true,\n ...props\n}: ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean;\n}) => (\n \n {children}\n {showRemove && (\n }\n >\n \n \n )}\n \n);\n\nconst ComboboxChipsInput = ({ className, ...props }: ComboboxPrimitive.Input.Props) => (\n \n);\n\nconst useComboboxAnchor = () => React.useRef(null);\n\nexport {\n Combobox,\n ComboboxInput,\n ComboboxContent,\n ComboboxList,\n ComboboxItem,\n ComboboxGroup,\n ComboboxLabel,\n ComboboxCollection,\n ComboboxEmpty,\n ComboboxSeparator,\n ComboboxChips,\n ComboboxChip,\n ComboboxChipsInput,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor,\n};\n",
"type": "registry:ui",
"target": ""
}
],
"type": "registry:ui"
}