Accordion (old version)

This pattern is no longer supported

This old method of implementing the accordion pattern is deprecated and will be removed in a future version of the digital pattern library. Please refer to the current accordion pattern for the correct method.

The accordion pattern presents an expandable and collapsible section of content. Accordions shorten pages and reduce scrolling, but they require users to click on topic headings to find information. Therefore, accordions should be used sparingly. For more information see the Nielsen Norman Group report on accordion usability.

Rules for accordions

  • Must not be used when your audience needs most or all of the content on the page to answer their questions. It is better to show all page content at once when the user case supports it. In such cases, do not worry about page length.
  • May be used when only one option is relevant to the user e.g. UK, Europe, USA.
  • May be used where you want to step a user through a process e.g. step 1, step 2, step 3.
  • The content within accordions must not contain any headings.
  • May be used anywhere in a content section.

Options available


Single accordion - deprecated

This option is no longer supported

This implementation is now deprecated and will be removed in a future release.

Consider if the content would be better visible at all times before using a single accordion to hide it from the user.

Example
Code
<!-- Begin pattern: accordion-deprecated //-->
<div class="accordion">
    <h3 aria-expanded="false" aria-controls="" role="tab" tabindex="0">Divinity</h3>
    <div id="" aria-hidden="true" role="tabpanel"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac rutrum tellus, quis porttitor urna. Donec ultricies libero erat, id efficitur risus blandit nec. Donec et ipsum in dui blandit rutrum. Praesent rhoncus lobortis ligula, viverra tincidunt ante lobortis at. Sed vehicula luctus quam sit amet lacinia. Sed eu nulla vel ex tempus accumsan in sit amet metus. Vestibulum a venenatis mi. Ut ac semper arcu.</p></div>
</div>
<!-- End pattern: accordion-deprecated //-->

Multiple accordions - deprecated

This option is no longer supported

This implementation is now deprecated and will be removed in a future release.

Example
Code
<!-- Begin pattern: accordion-deprecated //-->
<div class="accordion">
    <h3 aria-expanded="false" aria-controls="" role="tab" tabindex="0">Divinity</h3>
    <div id="" aria-hidden="true" role="tabpanel"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac rutrum tellus, quis porttitor urna. Donec ultricies libero erat, id efficitur risus blandit nec. Donec et ipsum in dui blandit rutrum. Praesent rhoncus lobortis ligula, viverra tincidunt ante lobortis at. Sed vehicula luctus quam sit amet lacinia. Sed eu nulla vel ex tempus accumsan in sit amet metus. Vestibulum a venenatis mi. Ut ac semper arcu.</p></div>
</div>
<div class="accordion">
    <h3 aria-expanded="false" aria-controls="" role="tab" tabindex="0">Geography</h3>
    <div id="" aria-hidden="true" role="tabpanel"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac rutrum tellus, quis porttitor urna. Donec ultricies libero erat, id efficitur risus blandit nec. Donec et ipsum in dui blandit rutrum. Praesent rhoncus lobortis ligula, viverra tincidunt ante lobortis at. Sed vehicula luctus quam sit amet lacinia. Sed eu nulla vel ex tempus accumsan in sit amet metus. Vestibulum a venenatis mi. Ut ac semper arcu.</p></div>
</div>
<div class="accordion">
    <h3 aria-expanded="false" aria-controls="" role="tab" tabindex="0">History</h3>
    <div id="" aria-hidden="true" role="tabpanel"><p>Morbi pellentesque, mauris nec porta laoreet, neque magna tempor eros, eget suscipit tellus purus nec ligula. In accumsan turpis eu porttitor tempus. Praesent rutrum quam id felis consequat, et mattis elit laoreet. Nunc maximus, dui vitae tincidunt elementum, elit tortor mattis quam, ut sodales arcu lectus eu nisi. Phasellus tincidunt at risus nec fringilla. Nunc ultricies nisl sodales, vestibulum nunc in, vulputate nisl. Vestibulum lacinia auctor hendrerit. Sed in lectus dapibus, volutpat justo vel, pellentesque ipsum. Vivamus vitae metus euismod, vestibulum odio eu, elementum quam.</p></div>
</div>
<div class="accordion">
    <h3 aria-expanded="false" aria-controls="" role="tab" tabindex="0">Physics</h3>
    <div id="" aria-hidden="true" role="tabpanel"><p>Quisque porttitor nisi sed justo posuere, ut sagittis lectus sodales. Proin tempus posuere libero. Quisque mauris ex, commodo vel finibus eu, iaculis id risus. Aenean id lorem vel lectus varius hendrerit vehicula quis sapien. Vestibulum non accumsan ante, et ullamcorper massa. In dictum mauris non accumsan gravida. Aliquam tortor mi, porttitor non feugiat eu, fermentum id magna. Nunc ornare mi risus, a cursus dui commodo at.&lt;/p&gt;&lt;p&gt;Nullam non interdum mauris, quis molestie sem. Proin aliquam purus vel pellentesque mollis. Curabitur vitae augue at velit sollicitudin consequat. Donec id convallis dui. Donec fringilla non justo at hendrerit. Proin dictum viverra cursus. Etiam eu viverra dui, at convallis diam. Donec finibus ut sapien ac dignissim. Nullam pulvinar mollis efficitur.</p></div>
</div>
<!-- End pattern: accordion-deprecated //-->