Skip to content
easeweb
Search topics

Carousels that keyboard and screen reader users can't use

A homepage carousel's arrows and dots take only clicks, or, once they are buttons, still show which slide is current by colour alone.

WCAG 2.2
SC 2.1.1ASC 4.1.2A
Required by
Section 508 · EN 301 549 (EU)
Broken <div class="carousel-next"></div>
The accessibility problem illustrated: Motor:How do I see the next slide?
01

The problem

Keyboard users can't show any slide but the first, and even once the arrows and dots work, screen reader users aren't told which slide is showing, because the current dot is marked only by colour

02

Try it

Show the second slide with Tab, and check that a screen reader would know it is showing

  • Broken 1: press Tab. It skips the arrows and dots. The panel below shows what a screen reader says.

  • Broken 2: the arrows and dots work with the keyboard, but watch the panel: no dot is ever said to be current, so nothing tells a screen reader which slide is showing.

  • Apply the fix. Press an arrow or a dot: is the new slide read out? Then Tab through the dots: is the current one said to be current?

Broken Can you fix this?

Paper and light

Our autumn exhibition, until 31 January.

See the exhibition
Opening times

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Make the arrows and dots named buttons

Before

Arrows and dots that take only clicks

<div class="carousel">  <div class="slides">    <div class="slide">      <h2>Paper and light</h2>      <p>Our autumn exhibition, until 31 January.</p>      <a href="/exhibitions/paper-and-light">See the exhibition</a>    </div>    <div class="slide" hidden>      <h2>Open late on Fridays</h2>      <p>Galleries and café open until 9 pm.</p>      <a href="/visit">Plan your visit</a>    </div>    <div class="slide" hidden>      <h2>Become a member</h2>      <p>Free entry all year, and a first look at every new show.</p>      <a href="/membership">Join today</a>    </div>  </div>  <div class="carousel-prev"></div>  <div class="carousel-next"></div>  <div class="carousel-dots">    <span class="carousel-dot is-current"></span>    <span class="carousel-dot"></span>    <span class="carousel-dot"></span>  </div></div>
What is wrong4 points
  • The keyboard can't show another slide. The arrows are divs and the dots are spans that respond only to click, so they have no Tab stop.
  • A screen reader never announces the arrows or dots, because they have no name and no role.
  • Only colour shows which slide is current. The current dot is marked by the is-current class, which changes its colour and nothing else.
  • A screen reader user isn't told the slide changed: the new slide replaces the old one without a word.
After
FixArrows and dots as buttons
<section class="carousel" aria-roledescription="carousel" aria-label="Highlights">  <button type="button" class="carousel-prev">    <svg aria-hidden="true" focusable="false">      <use href="#icon-previous"></use>    </svg>    <span class="visually-hidden">Previous slide</span>  </button>  <button type="button" class="carousel-next">    <svg aria-hidden="true" focusable="false">      <use href="#icon-next"></use>    </svg>    <span class="visually-hidden">Next slide</span>  </button>  <div class="slides" aria-live="polite">    <div class="slide" role="group" aria-roledescription="slide" aria-label="1 of 3">      <h2>Paper and light</h2>      <p>Our autumn exhibition, until 31 January.</p>      <a href="/exhibitions/paper-and-light">See the exhibition</a>    </div>    <div class="slide" role="group" aria-roledescription="slide" aria-label="2 of 3" hidden>      <h2>Open late on Fridays</h2>      <p>Galleries and café open until 9 pm.</p>      <a href="/visit">Plan your visit</a>    </div>    <div class="slide" role="group" aria-roledescription="slide" aria-label="3 of 3" hidden>      <h2>Become a member</h2>      <p>Free entry all year, and a first look at every new show.</p>      <a href="/membership">Join today</a>    </div>  </div>  <div class="carousel-dots">    <button type="button" class="carousel-dot" aria-current="true">      <span class="visually-hidden">Slide 1</span>    </button>    <button type="button" class="carousel-dot">      <span class="visually-hidden">Slide 2</span>    </button>    <button type="button" class="carousel-dot">      <span class="visually-hidden">Slide 3</span>    </button>  </div></section>
How it is fixed6 steps
  1. Make the arrows and dots real buttons, each named by its hidden text. Tab reaches them and Enter and Space press them, with no key handling to write.
  2. Put the arrows before the slides, so the keyboard meets them first.
  3. In show(), set aria-current="true" on the current dot, so a screen reader says "current" on it.
  4. Draw the filled dot from [aria-current='true'], so the look and the announcement can't disagree.
  5. As good practice, make the slides a polite live region. It reads the new slide to screen reader users who press an arrow or a dot, without moving their focus.
  6. Label each slide "1 of 3" and so on, so it says which of the three it is.

This fixes both Befores and passes 2.1.1 and 4.1.2.

Why this fix: Use native HTML first

04

Design ideas

Arrows and dots are only one way to draw it

Seven ways to draw the museum’s carousels: a hero of three slides, and a shelf of events that shows several at once. Click through each, then put the mouse aside and use Tab: five work for every way of using the page, and two only for some.

In the design file

  • Draw each arrow and dot at least 24 by 24 pixels, or 24 pixels from the centre of one to the centre of the next.
  • Put the arrows on the plain page, or on a solid circle over the photo, so their 3:1 contrast doesn’t depend on the picture.
  • Show the current slide with more than a colour, such as a filled shape, a bar, bold type or a number.
  • Write the name of each arrow and dot beside it, such as “Next slide” or “Slide 2”.
  • Draw the focus ring on a tile at the edge of a shelf, with room so it isn’t cut off.

Passes

Fails

05

Verify the fix

4 checks, no mouse.

Test with: Keyboard, Screen reader, Forced colors

0 of 4 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the carousel, its slides or its library change.

How screen readers handle aria-current="page"

Limits

This is a starting pattern, not a guarantee for every application. It covers how the arrows and dots are reached and what they say. A carousel that also turns by itself needs a way to stop it as well (2.2.2): see tickers, carousels and animations that can't be paused, which also covers why pausing on hover or focus is an extra, not the way to stop it. The text over each slide still needs enough contrast against its picture (1.4.3), and a slide's picture needs alt text when it carries information. A product gallery with thumbnails and a zoom has failures of its own: see product photo thumbnails that need a mouse or say nothing and product photo zoom that needs a mouse.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service