Collapse
A heading that reveals related content. Stack several in CollapseGroup for an accordion.
Default
Inside a group, opening one panel closes the others.
Expanded
defaultExpanded opens a panel on mount. In a single-select group, only the first such panel stays open.
Multiple
multiple lets independent panels stay open together.
Small
small is 13px with tighter padding. Use it in dense settings, not as page structure.
Controlled
Pass expanded and listen for update:expanded when the parent owns the open state. The title slot replaces the title prop.
Best practices
- Collapse hides optional or repetitive content (FAQ, advanced settings, payload preview). Primary page structure stays as normal headings.
- One optional block is a lone Collapse. A related set goes in
CollapseGroup. Sibling views of the same data are Tabs. - Default closed unless the first visit cannot act without the body. In a group, skip
multiplewhen items are mutually exclusive. - Title Case the heading and name the topic, not the action —
Advanced Settings, notShow Advanced Settings. - Do not nest Collapse more than one level. Do not bury a primary destructive action inside a closed panel.
- Sizes are
medium(default) andsmall. The trigger already exposesaria-expandedandaria-controls.