Read This First
No ARIA is better than Bad ARIA. Before using any ARIA, read this to understand why.
How to build accessibility semantics into web patterns and widgets
No ARIA is better than Bad ARIA. Before using any ARIA, read this to understand why.
An accordion is a vertically stacked set of interactive headings that each contain a title, content snippet, or thumbnail representing a section of content. The headings function as controls that enable users to reveal or hide their associated sections of content. Accordions are commonly used to reduce the need to scroll when presenting multiple sections of content on a single page.
Terms for understanding accordions include:
In some accordions, there are additional elements that are always visible adjacent to the accordion header. For instance, a menubutton may accompany each accordion header to provide access to actions that apply to that section. And, in some cases, a snippet of the hidden content may also be visually persistent.
Accordion Example: demonstrates a form divided into three sections using an accordion to show one section at a time.
button
is wrapped in an element with role heading that has a value set for aria-level that is appropriate for the information architecture of the page.
heading
and aria-level
, such as an HTML heading tag, a native host language element may be used.button
element is the only element inside the heading
element. That is, if there are other visually persistent elements, they are not included inside the heading
element.button
element has aria-expanded set to true
. If the panel is not visible, aria-expanded is set to false
.button
element has aria-controls set to the ID of the element containing the accordion panel content.button
element has aria-disabled set to true
.region
role in circumstances that create landmark region proliferation, e.g., in an accordion that contains more than approximately 6 panels that can be expanded at the same time.region
is especially helpful to the perception of structure by screen reader users when panels contain heading elements or a nested accordion.This is an unpublished draft preview that might include content that is not yet approved. The published website is at w3.org/WAI/.