{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "collapsible",
  "type": "registry:ui",
  "title": "Collapsible",
  "description": "One section that a button opens and closes in place.",
  "categories": [
    "ui"
  ],
  "dependencies": [
    "radix-ui"
  ],
  "registryDependencies": [
    "@rivier-ui/theme",
    "@rivier-ui/cn"
  ],
  "files": [
    {
      "path": "registry/ui/collapsible.tsx",
      "type": "registry:ui",
      "target": "components/ui/collapsible.tsx",
      "content": "\"use client\";\n/**\n * @name collapsible\n * @category ui\n * @description One section that a button opens and closes in place.\n * @when A single part of a page that is hidden until asked for: more options under a form, the rest of a long list, details under a summary. The trigger is yours to style (a Button through asChild). For several sections under headings use accordion; for content that floats over the page use popover.\n * @example\n * <Collapsible>\n *   <CollapsibleTrigger asChild><Button variant=\"ghost\" size=\"sm\">More options</Button></CollapsibleTrigger>\n *   <CollapsibleContent>\n *     <p>Shown only while open.</p>\n *   </CollapsibleContent>\n * </Collapsible>\n */\nimport { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\n/** Holds the open state: `open`, `defaultOpen`, `onOpenChange`; `disabled` locks it as it is. */\nexport function Collapsible(props: ComponentProps<typeof CollapsiblePrimitive.Root>) {\n  return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\n/** The button. It carries `aria-expanded` and `data-state` (\"open\" or \"closed\"), so a chevron in it can turn with `group-data-[state=open]`. */\nexport function CollapsibleTrigger(props: ComponentProps<typeof CollapsiblePrimitive.Trigger>) {\n  return <CollapsiblePrimitive.Trigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\n/*\n * No height animation, for the reason given in accordion: only transform and opacity move. The section takes\n * its height at once and its content fades and settles in; closing is immediate.\n */\nexport function CollapsibleContent({ className, ...props }: ComponentProps<typeof CollapsiblePrimitive.Content>) {\n  return (\n    <CollapsiblePrimitive.Content\n      data-slot=\"collapsible-content\"\n      className={cn(\"ease-out animation-duration-(--duration-base) fade-in-0 slide-in-from-top-1 data-[state=open]:animate-in motion-reduce:animate-none!\", className)}\n      {...props}\n    />\n  );\n}\n"
    }
  ],
  "meta": {
    "category": "ui",
    "when": "A single part of a page that is hidden until asked for: more options under a form, the rest of a long list, details under a summary. The trigger is yours to style (a Button through asChild). For several sections under headings use accordion; for content that floats over the page use popover.",
    "example": "<Collapsible>\n  <CollapsibleTrigger asChild><Button variant=\"ghost\" size=\"sm\">More options</Button></CollapsibleTrigger>\n  <CollapsibleContent>\n    <p>Shown only while open.</p>\n  </CollapsibleContent>\n</Collapsible>",
    "client": true
  }
}
