Components › Display
Collapsible
Shows and hides one section, growing smoothly to its height. For a list of sections, use Accordion.
Installation
npx plankui@latest add collapsibleUsage
import { Collapsible } from "@/components/ui/collapsible";
<Collapsible>
<CollapsibleTrigger>Show</CollapsibleTrigger>
<CollapsibleContent>Hidden details</CollapsibleContent>
</Collapsible>API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| open / defaultOpen | boolean | false | Whether the content shows. |
| onOpenChange | (open: boolean) => void | Called when it opens or closes. | |
| CollapsibleTrigger asChild | boolean | false | Use your own button as the trigger. |