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.
A carousel presents a set of items, referred to as slides, by sequentially displaying a subset of one or more slides. Typically, one slide is displayed at a time, and users can activate a next or previous slide control that hides the current slide and "rotates" the next or previous slide into view. In some implementations, rotation automatically starts when the page loads, and it may also automatically stop once all the slides have been displayed. While a slide may contain any type of content, image carousels where each slide contains nothing more than a single image are common.
Ensuring all users can easily control and are not adversely affected by slide rotation is an essential aspect of making carousels accessible. For instance, the screen reader experience can be confusing and disorienting if slides that are not visible on screen are incorrectly hidden, e.g., displayed off-screen. Similarly, if slides rotate automatically and a screen reader user is not aware of the rotation, the user may read an element on slide 1, execute the screen reader command for next element, and, instead of hearing the next element on slide 1, hear an element from slide 2 without any knowledge that the element just announced is from an entirely new context.
Features needed to provide sufficient rotation control include:
The following terms are used to describe components of a carousel.
This section describes the element composition for three styles of carousels:
carousel
.aria-roledescription
is set to "carousel", the label does not contain the word "carousel".
aria-pressed
, specified.
slide
.aria-roledescription
is set to "slide", the label does not contain the word "slide."false
and aria-live set to:
off
: if the carousel is automatically rotating.polite
: if the carousel is NOT automatically rotating.The structure of a tabbed carousel is the same as a basic carousel except that:
group
, and it does not have the aria-roledescription
property.tab
element, so activating a tab displays the slide associated with that tab.tab
indicates which slide it will display by including the name or number of the slide, e.g., "Slide 3".
Slide names are preferable if each slide has a unique name.
tablist
element with an accessible name provided by the value of aria-label that identifies the purpose of the tabs, e.g., "Choose slide to display."tab
, tablist
, and tabpanel
implement the properties specified in the tabs pattern.A grouped carousel has the same structure as a basic carousel, but it also includes slide picker controls where:
group
element.
true
.
Note: aria-disabled
is preferable to the HTML disabled
attribute because this is a circumstance where screen reader users benefit from the disabled button being included in the page Tab sequence.
This is an unpublished draft preview that might include content that is not yet approved. The published website is at w3.org/WAI/.