The accordion component lets users show and hide sections of related content on a page.  

The component loads with all sections hidden. To show a section, the user can interact anywhere in the heading button.   

{{ aspExample({ code: "", nunjucks: "", json: "", title: "", example: "default", id: "65a928bb3e09f" }) }}

When to use this component

Use an accordion to help users: 

For example, an accordion can work well if the user needs to reveal and compare information that’s relevant to them. 

When not to use this component

Accordions hide content from the user. Not all users will notice them or understand how they work. For this reason, you should only use them in specific situations and if user research supports it. 

Do not use an accordion for content that all users need to see. 

Test your content without an accordion first. Well-written and structured content can remove the need to use an accordion. 

It’s usually better to: 

Accordions work best for simple content and links. Do not use accordions to split up a series of questions. Use separate pages instead. 

Do not put accordions within accordions, as it will make content difficult to find. 

Example of where we have used this component

This component is used on: 

This list is not exhaustive.  

Status of development

The below criteria all need to be met for a component to be considered as fully developed for use within the ASP Digital Design System.


{{ aspTable({
head: [
{ text: 'Development criteria'},
{ text: 'Status'}
],
rows: [
{
cells: [
{ text: 'WCAG 2.2 compliant'},
{ html: '<span class="asp-status">Not started</span>'}
]
},
{
cells: [
{ text: 'WCAG 2.1 compliant'},
{ html: '<span class="asp-status asp-status–green">Completed</span>'}
]
},
{
cells: [
{ text: 'HTML / Nunjucks version'},
{ html: '<span class="asp-status asp-status–green">Completed</span>'}
]
},
{
cells: [
{ text: 'Figma version'},
{ html: '<span class="asp-status">Not started</span>'}
]
},
{
cells: [
{ text: 'M365 versions'},
{ html: '<span class="asp-status">Not started</span>'}
]
},
{
cells: [
{ text: 'Documentation'},
{ html: '<span class="asp-status asp-status–yellow">In progress</span>'}
]
}
]
}) }}