Components · Data Display · Collapse
Back to Collapse typesCollapse
Use for progressively disclosing long or secondary content behind a clickable header - one Collapse component, controlled by properties, not a one-off show/hide toggle rebuilt per screen.
Properties
Corner radius, size, header text, body text and chevron visibility are properties of the same component, not separate panels - change them below to check this collapse's types and states in the Live Preview.
Live Preview
Both types compared side by side, each in all 3 states - Collapsed, Expanded and Disabled. One full matrix is rendered per selected combination of Corner radius and Size, with the current header text, body text and chevron visibility applied throughout.
When to use
Any long or secondary content that benefits from being hidden by default and revealed on demand.
Component Guide
Overview
Collapse progressively discloses long or secondary content behind a clickable header - the content stays hidden until expanded, keeping the page compact while still making the detail available on demand.
When to Use
- An FAQ list - each question collapsed until clicked.
- Settings section grouping or filter panel sections - organizing a long settings page into expandable chunks.
- An order details breakdown or terms and conditions section - long content that most users won't need expanded by default.
When Not to Use
- Content everyone needs to see immediately - hiding essential information behind a click adds friction; show it directly instead.
- A single, always-visible section with no reason to hide it - a static Card or plain section is simpler when there's no benefit to collapsing.
- Switching between different views of content rather than showing/hiding one section - use Tabs instead of Collapse.
Best Practices
- Make the whole header row clickable, not just a small chevron icon, so the hit target is generous.
- Default the most commonly needed section open when there's a clear default, rather than collapsing everything.
- Animate the expand/collapse transition smoothly so content doesn't just snap in and out abruptly.
Do and Don't
Do
A header naming exactly what is inside, so opening it is a deliberate choice rather than a guess.
Don't
Two panels both titled something generic give the user no way to predict which one holds what they need - they have to open both.
Accessibility
- The header exposes aria-expanded, reflecting whether its panel is currently open.
- The header is a real, keyboard-operable button, not a div with only a click handler.
- The expanded panel is programmatically associated with its header via aria-controls, so the relationship is explicit.
Related Components
Tabs, Card, Description.
{
"component": "Collapse",
"category": "Data Display",
"summary": "Collapse progressively discloses long or secondary content behind a clickable header - the content stays hidden until expanded, keeping the page compact while still making the detail available on demand.",
"whenToUse": [
"An FAQ list - each question collapsed until clicked.",
"Settings section grouping or filter panel sections - organizing a long settings page into expandable chunks.",
"An order details breakdown or terms and conditions section - long content that most users won't need expanded by default."
],
"whenNotToUse": [
"Content everyone needs to see immediately - hiding essential information behind a click adds friction; show it directly instead.",
"A single, always-visible section with no reason to hide it - a static Card or plain section is simpler when there's no benefit to collapsing.",
"Switching between different views of content rather than showing/hiding one section - use Tabs instead of Collapse."
],
"bestPractices": [
"Make the whole header row clickable, not just a small chevron icon, so the hit target is generous.",
"Default the most commonly needed section open when there's a clear default, rather than collapsing everything.",
"Animate the expand/collapse transition smoothly so content doesn't just snap in and out abruptly."
],
"doAndDont": {
"do": "A header naming exactly what is inside, so opening it is a deliberate choice rather than a guess.",
"dont": "Two panels both titled something generic give the user no way to predict which one holds what they need - they have to open both."
},
"accessibility": [
"The header exposes aria-expanded, reflecting whether its panel is currently open.",
"The header is a real, keyboard-operable button, not a div with only a click handler.",
"The expanded panel is programmatically associated with its header via aria-controls, so the relationship is explicit."
],
"relatedComponents": [
"Tabs",
"Card",
"Description"
]
}