{{ aspExample({ code: "<details class=\"asp-accordion\">
<summary class=\"asp-accordion__summary\">
<span class=\"asp-accordion__title\">
<svg class=\"asp-accordion__icon\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 10 10\">
<rect class=\"asp-accordion__icon-vertical\" height=\"8\" width=\"2\" y=\"1\" x=\"4\"></rect>
<rect height=\"2\" width=\"8\" y=\"4\" x=\"1\"></rect>
</svg>
Accordion title
</span>
</summary>
<div class=\"asp-accordion__text\">
<p>Accordion content</p>
</div>
</details>", nunjucks: "{{ aspAccordion({
summary: \"Accordion summary\",
content: {
html: '<p>Accordion content (html) with a <a href=\"#\">link</a>.</p>'
}
}) }}", title: "", id: "65a928bb3e09f", url: "" }) }}

When to use this component

‘Accordion’ allow us to hide content until the user interacts with the element, at which point content is shown in a drop down.

This element can be used to break up long pages of content, using clear headers to help the user navigate.

Future considerations

Remove SVG from inline – either background CSS or ::before or ::after pseudo

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="status">Not started</span>'}
]
},
{
cells: [
{ text: 'WCAG 2.1 compliant'},
{ html: '<span class="status status–green">Completed</span>'}
]
},
{
cells: [
{ text: 'HTML / Nunjucks version'},
{ html: '<span class="status status–green">Completed</span>'}
]
},
{
cells: [
{ text: 'Figma version'},
{ html: '<span class="status status">Not started</span>'}
]
},
{
cells: [
{ text: 'M365 versions'},
{ html: '<span class="status status">Not started</span>'}
]
},
{
cells: [
{ text: 'Documentation'},
{ html: '<span class="status status–yellow">In progress</span>'}
]
}
]
}) }}