Accordion
Overview
Accordions allows users to expand and collapse content, providing a space-efficient way to progressively disclose information. They help organise and present complex information in a structured and user-friendly manner.
Live demo
- List item 2
- List item
- List item
- List item 2
- List item
- List item
- List item 2
- List item
- List item
Usage
Do
Use when needing to condense large amounts of information into a compact space.
Clearly label each Accordion item header to indicate the content it contains.
Use icons or arrows to indicate expand/collapse actions to make Accordions more discoverable.
Ensure the Accordion works well on various screen sizes and devices.
Don't
Avoid placing excessive content within Accordion items, as it may defeat the purpose of decluttering.
Important information should remain visible even when Accordions are collapsed.
Ensure the Accordion is accessible to users with disabilities, providing proper focus and ARIA attributes.
If there's only a small amount of content, consider displaying it without an Accordion for a simpler user experience.
Don’t nest Accordions inside other Accordions.
Sizes
There are 4 size variants for the Accordion component; small, medium, large, x-large.
| Size | Example |
|---|---|
| Medium (default) | Single item Expanded content |
| Small | Single item Expanded content |
| Large | Single item Expanded content |
| X-Large | Single item Expanded content |
States and interactions
| Size | Example |
|---|---|
| Enabled | Accordion title Content |
| Disabled | Accordion title Content |
| Hover | Accordion title Content |
| Focused | Accordion title Content |
Accessibility
Enhance accessibility by including appropriate ARIA roles and attributes, such as aria-expanded and aria-labelledby.
Regularly test the Accordion with screen readers to ensure compatibility and a smooth experience for users with visual impairments. Make sure all Accordion interactions are operable using a keyboard alone.
iOS guidance
Along with the guidance above, there is some iOS specific guidance for this component.
Leverage iOS-specific animations for smooth and visually appealing transitions when expanding or collapsing Accordion sections.
Test and optimise the Accordion for various iOS devices, including iPhones and iPads.
Leverage iOS accessibility features and test with VoiceOver to ensure a seamless experience for users with disabilities.