{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "accordion-smooth",
  "title": "Smooth Accordion",
  "author": "VenusUI",
  "description": "An accordion whose panels open with a smooth height animation, no measuring needed.",
  "dependencies": [
    "lucide-react"
  ],
  "files": [
    {
      "path": "registry/default/ui/accordion-smooth.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { ChevronDown } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface AccordionItem {\n  id: string\n  title: React.ReactNode\n  content: React.ReactNode\n}\n\ninterface AccordionSmoothProps {\n  items: AccordionItem[]\n  /** Allow several items open at once. */\n  multiple?: boolean\n  /** Items open at first. */\n  defaultOpen?: string[]\n  className?: string\n}\n\n/**\n * An accordion whose panels open with a smooth height animation (CSS grid\n * rows, no measuring). Headers are buttons with `aria-expanded` and\n * `aria-controls`. Opens instantly with reduced motion.\n */\nfunction AccordionSmooth({ items, multiple = false, defaultOpen = [], className }: AccordionSmoothProps) {\n  const [open, setOpen] = React.useState<string[]>(defaultOpen)\n  const id = React.useId()\n\n  function toggle(itemId: string) {\n    setOpen((current) => {\n      const isOpen = current.includes(itemId)\n      if (isOpen) return current.filter((x) => x !== itemId)\n      return multiple ? [...current, itemId] : [itemId]\n    })\n  }\n\n  return (\n    <div data-slot=\"accordion-smooth\" className={cn(\"w-full divide-y rounded-xl border\", className)}>\n      {items.map((item) => {\n        const expanded = open.includes(item.id)\n        const buttonId = `${id}-button-${item.id}`\n        const panelId = `${id}-panel-${item.id}`\n        return (\n          <div key={item.id}>\n            <h3>\n              <button\n                id={buttonId}\n                type=\"button\"\n                aria-expanded={expanded}\n                aria-controls={panelId}\n                onClick={() => toggle(item.id)}\n                className=\"flex w-full items-center justify-between gap-4 px-4 py-3.5 text-left text-sm font-medium outline-none hover:bg-muted/40 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset\"\n              >\n                {item.title}\n                <ChevronDown\n                  aria-hidden=\"true\"\n                  className={cn(\"size-4 shrink-0 text-muted-foreground transition-transform duration-300 motion-reduce:transition-none\", expanded && \"rotate-180\")}\n                />\n              </button>\n            </h3>\n            <div\n              id={panelId}\n              role=\"region\"\n              aria-labelledby={buttonId}\n              className={cn(\n                \"grid transition-[grid-template-rows] duration-300 ease-out motion-reduce:transition-none\",\n                expanded ? \"grid-rows-[1fr]\" : \"grid-rows-[0fr]\"\n              )}\n            >\n              <div className=\"overflow-hidden\" inert={!expanded ? true : undefined}>\n                <div className=\"px-4 pb-4 text-sm text-muted-foreground\">{item.content}</div>\n              </div>\n            </div>\n          </div>\n        )\n      })}\n    </div>\n  )\n}\n\nexport { AccordionSmooth, type AccordionItem, type AccordionSmoothProps }\n",
      "type": "registry:ui"
    }
  ],
  "meta": {
    "version": "0.1.0"
  },
  "categories": [
    "interactive",
    "animations"
  ],
  "type": "registry:ui"
}