Atomx Docs
Components

Collapsible

An interactive component that toggles the visibility of a content panel, built on Radix UI's Collapsible primitive.

Install

npx shadcn@latest add https://atomx.acau.net/r/collapsible.json

Usage

Collapsible wraps Radix UI's Collapsible.Root. Place any element as CollapsibleTrigger — it toggles the CollapsibleContent. Use open and onOpenChange for controlled mode, or let it manage state internally.

<Collapsible>
  <CollapsibleTrigger asChild>
    <Button variant="outline">Toggle</Button>
  </CollapsibleTrigger>
  <CollapsibleContent>
    <p>This content is revealed when open.</p>
  </CollapsibleContent>
</Collapsible>

Preview

Props

Collapsible extends React.ComponentProps<typeof CollapsiblePrimitive.Root>.

PropTypeNotes
openbooleanControlled open state.
defaultOpenbooleanInitial open state when uncontrolled.
onOpenChange(open: boolean) => voidFired when open state changes.
disabledbooleanPrevents toggle interaction.

CollapsibleTrigger and CollapsibleContent forward all props to their Radix primitives.