Accordion
Description
Accordions hide sections of content on a page under a heading, allowing the user to show them when needed, keeping the page easier to scan and navigate.
Accordions can be used singly or added together.
When to use
Only use an accordion when users can make a decision about whether to open it from the heading alone.
- to make supplementary information easily available without overwhelming users with content they may not need immediately
- when reducing visible content will help users scan the page more easily and find the information relevant to them, such as delivery options
- for essential content that all users need to see - content hidden within accordions may be overlooked by users
- for content that users may intend to copy or print
- if the intent is only to reduce page length - instead consider splitting the content across pages or simplify the content
Guidelines for use
An accordion consists of a heading level 3, an expand/collapse control, rich text and a divider. It supports four interactive states: default, hover, focus and open.
- Title - the internal name for your accordion.
- Heading - add a heading to your accordion, this will display at heading level 3 (H3), ensure it follows the page heading hierarchy so heading levels remain sequential and meaningful to screen reader users. Keep it concise and descriptive so users can easily understand if the hidden content is relevant.
- Rich text editor - add the content that you want to appear when the accordion is open. Keep content concise. If content becomes lengthy, complex or contains key actions that all users need to complete, consider using page content or separate pages instead.
For full implementation guidance in Contentful, see Accordion component and Accordion assemblies | Shelter's Digital Framework.
Accessibility
This accordion component is designed to meet WCAG 2.1 Level AA requirements. Accordion controls can be accessed and operated using a keyboard, support screen readers by communicating expanded and collapsed states and provide visible focus indicators.
The entire accordion header area is selectable, rather than requiring users to target a small icon or text label.
Accordion headers use H3 headings, so ensure they fit appropriately within the page's semantic heading structure.
For detailed information about our accessibility standards, see our Accessibility Statement.