{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "author": "DesignX ", "name": "icon-accordion", "type": "registry:component", "title": "Icon Accordion", "description": "A horizontal accordion where icons expand into cards.", "dependencies": [ "lucide-react@^0.577.0", "motion@^14.0.0" ], "registryDependencies": [ "@dx/utils" ], "files": [ { "path": "dx/icon-accordion.tsx", "type": "registry:component", "target": "components/dx/icon-accordion.tsx", "content": "import * as React from \"react\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { ChevronDown } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\n/**\n * IconAccordiona stacked list where the open row detaches into its own\n * pill and neighbours round their corners to meet it.\n *\n */\n\ntype IconAccordionItem = { icon: React.ReactNode; title: string; description: React.ReactNode };\n\ntype IconAccordionProps = {\n items: IconAccordionItem[];\n value?: number | null;\n defaultValue?: number | null;\n onValueChange?: (value: number | null) => void;\n radius?: number;\n className?: string;\n};\n\nfunction IconAccordion({ items, value, defaultValue = null, onValueChange, radius = 20, className }: IconAccordionProps) {\n const [internal, setInternal] = React.useState(defaultValue);\n const active = value !== undefined ? value : internal;\n const set = (v: number | null) => {\n if (value === undefined) setInternal(v);\n onValueChange?.(v);\n };\n const r = `${radius}px`;\n const last = items.length - 1;\n\n return (\n \n );\n}\n\nexport { IconAccordion };\nexport type { IconAccordionItem, IconAccordionProps };\n" } ], "categories": [ "motion" ], "meta": { "group": "dx", "docs": "https://dxuireact.com/docs/components/icon-accordion" } }