*This site is a work-in-progress and some pages are more complete than others. If you have any questions or issues, please email nick.harris@reckitt.com. *

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »



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

Usage

Do’s

  • Use accordion when you have multiple related pieces of content.

  • Use accordion when only some of the content items are relevant to any one user. FAQs are a great example as not all questions are of interest to everyone.

Dont’s

  • Don’t use accordion when content is relevant to all users.

  • Don’t use accordion when content within the accordion is very complex or can cause slow page loads.

Anatomy

Insert image here

Item

Component type

Content type

Notes

1

List item

Text

2

Item title

Text

3

Item content

RTA

Visual style

n/a

Editorial

  • Keep accordion titles short, but long enough to clearly communicate what a user can expect to find inside. This is especially required for unsighted users.

Behaviour

  • Accordion items are collapsed by default.

  • Each accordion is individually controlled with a toggle between expanded and collapsed.

  • Each accordion includes hover, focus and disabled and active states. CSS ‘focus-visible’ will remove visual focus for mouse-controlled accordions.

  • Mouse click or touch on the accordion title will toggle between expand and collapse.

  • Once focused, Enter or Space on a keyboard will toggle expand or collapse.

  • Items within an accordion ‘list’ can be traverse forwards with tab and backwards with shift+tab.

  • Where Javascript is disabled, all accordions are expanded by default and expand/collapse controls are not present.

Accessibility


Related components

tbd


To be added later:

<section>            Use when the drawer title is a semantic heading. Wrapping the content in a section means that we can programmatically determine headings and this will make the heading a child of the heading that came before (e.g. a section header H2)

 

<div>                     Use when the drawer title is not a heading (e.g. a paragraph). Using section here would create a section without a heading which is bad practice.

 

<dl>                       Most appropriately used for FAQ lists and although it looks the same, it should be noted that the drawer titles will not be headings semantically and so won’t be as easily navigable by screen-reader users, but the list will appear to them. 

                                *We should test with screen-reader users to see if there is a clear preference to make navigation easy for them. If we have to do less accurate semantics in order to make content discoverable (e.g. with headings) then we should

 

<summary>        Do not use in accordions. Accordions are for multiple items.

  • No labels