Components
Collapsible
Expand/collapse container that reveals its CollapsibleContent when open.
Controlled via open/onOpenChange or uncontrolled via defaultOpen.
Usage
Best practices
Use
Collapsiblefor a single expand/collapse region; reach forAccordionwhen you have a set of grouped items where selecting one can close the others.Compose
CollapsibleTrigger+CollapsibleContentinside it - a bare child won't expand.Drive it uncontrolled with
defaultOpen; only lift toopen/onOpenChangewhen external state must sync (e.g. persisting the open panel).
Props
Also exports
- component
Collapsible - const
collapsibleAnatomy - component
CollapsibleTrigger