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.
<div class="carousel-next"></div> 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
A city museum opens its homepage with a carousel of three slides: the autumn exhibition, late opening on Fridays, and membership. Each slide has a heading, a line of text and a link. An arrow at each side and three dots underneath change the slide on a click, and the dot for the slide on show is filled in. The arrows and dots are divs and spans with click handlers. Pressing Tab goes from the first slide's link straight to the next link on the page, so a keyboard user only ever sees the first slide. A screen reader never hears the arrows or dots, the filled dot is only a colour, and when a mouse user changes the slide, nothing is read out.
Many carousels get halfway: the arrows and dots are real buttons with names, so the keyboard can change the slide. Even then, a screen reader user on the dots hears "Slide 2, button" with no word of which slide is the current one, and pressing Next says nothing at all. They can control the carousel but can't tell what it is showing.
Success criterion 2.1.1 Keyboard asks that everything the mouse can do, the keyboard can do. Showing the second or third slide is done only by clicking a div or a span, which take no focus, so the keyboard can't do it at all. Success criterion 4.1.2 Name, Role, Value asks that controls expose a name, a role and their current state. The arrows and dots expose no name and no role, and the dots show which slide is current only by colour, a state that is never exposed.
Turning the arrows and dots into buttons is not enough on its own. The current dot still shows its state only by colour: every dot reads as "Slide 1, button", "Slide 2, button" alike, so the state that says which slide is showing is never exposed, and 4.1.2 still fails. Pressing Next also swaps the content beside the button while focus stays on it, so a screen reader user hears nothing. Neither criterion requires that change to be announced, but without it they can't tell whether the press did anything. The ARIA Authoring Practices carousel reads the new slide out through a polite live region as good practice, and the fix below does the same.
The carousel is the first thing on the homepage, and the slides after the first hold the late opening and the membership offer. Anyone who can't use a mouse, or can't see the dots, never learns they are there.
2 of 10 groups affected
- No vision (affected)
- Low vision (not affected)
- Colour vision (not affected)
- No hearing (not affected)
- Hard of hearing (not affected)
- No speech (not affected)
- Motor (affected)
- Reach, strength (not affected)
- Cognitive (not affected)
- Seizures (not affected)
- Limited manipulation The arrows and dots take no focus, so keyboard, switch and voice control users can't show the second or third slide, or reach the links on them.
- Without vision The arrows and dots are never read, the current dot is only a filled circle, and a new slide arrives without a word, so a screen reader user can't tell there are other slides, which one is showing, or that it changed.
Arrows and dots built from divs and spans have no role, so axe has nothing to check. The audit reports them when they sit inside an element whose class names it as a carousel, slider or slideshow, have class names such as prev, next, arrow, dot or bullet, show a pointer cursor and never take focus. That covers the arrows of Swiper without its accessibility module and the dots of older Owl and Flickity versions, but not arrows a site has named some other way. When the arrows are buttons with only an icon, axe reports the missing name as button-name. No check can tell whether the current dot says it is current, or whether a new slide is read out. AI fixes often add role="button" and tabindex="0" to the divs and stop there, which gives a Tab stop that Enter and Space do nothing on; put aria-label on a div with no role, which many screen readers ignore; or add aria-live="assertive" with a "Slide changed" message, which interrupts and still doesn't say what the slide is.
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?
The fix
Make the arrows and dots named buttons
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-currentclass, 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.
<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
- 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.
- Put the arrows before the slides, so the keyboard meets them first.
- In
show(), setaria-current="true"on the current dot, so a screen reader says "current" on it. - Draw the filled dot from
[aria-current='true'], so the look and the announcement can't disagree. - 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.
- 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
The dots are optional. When the arrows are enough, keep the dots as a picture of where you are, with aria-hidden="true" and no click handler, so there is nothing for the keyboard to miss. When they stay clickable, each one needs everything a button needs.
- a name, here "Slide 1", in hidden text or
aria-label; - a target of at least 24 by 24 pixels, which a 12-pixel dot is not;
- a visible focus ring, and 3:1 contrast against what is behind it;
aria-current="true"on the current one, with its look drawn from that attribute rather than a class.
Keep the announcement short and polite. The live region reads the slide itself, its label and its content, so there is no need for a separate "Slide changed" message. aria-live="assertive" would cut off whatever the screen reader was saying.
aria-roledescription changes what a screen reader calls the region and each slide, so it goes on those two only, and in the page's language: "carousel" and "slide" in English, "カルーセル" and "スライド" in Japanese. The label "1 of 3" tells people where they are; the slide's heading says what it is about.
Swiping can stay, but it is an extra for touch screens, never the only way to change the slide. Many carousel libraries ship an accessibility option, such as Swiper's a11y module; turn it on, then check what it actually does with the steps below. The same applies to product carousels that show several cards at once: the arrows are named buttons, and what they bring into view is read out.
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
- Arrows beside the shelf’s heading The shelf many homepages run, with its arrows moved off the photos: two 36px outlined circles at the end of the heading row, the outline #767676 at 4.54:1 on white whatever picture is below. Every tile is still a link Tab reaches, and the next one peeks in at the edge to show there is more.
- A shelf with its scroll bar showing No arrows to build: a slim #1a1a1a bar on a #e8e4dc track under the tiles, 13.73:1 between them, lets a mouse drag along it. Tab scrolls each tile into view, and a phone swipes as usual. Some systems show the bar only while it scrolls, so let the next tile peek in as well.
- A counter between the arrows “2 / 3” in place of the dots says where you are in words, and leaves two targets to hit, each a 36px circle. It takes the width of one short word, so it fits under a phone-sized slide; a screen reader hears the slide’s own “2 of 3” instead.
- Slide titles in place of dots A short title for each slide under the picture, so people pick the one they want instead of guessing which dot leads where. The current one is bold #1a1a1a under a 3px bar, the others #555555 at 7.46:1, and each is a target 44px tall across a third of the width.
- Arrows on the edges, on solid circles The look of many feed and product shelves: 40px circles half over the first and last tile. Each is solid white with a #1a1a1a chevron, 17.40:1 against its own circle, so it reads on any photo, and a soft shadow lifts it off a white one. They cover the tiles’ corners, so keep each name under its picture.
Fails
What’s on
A shelf you can only dragWCAG 2.1.1 The cleanest shelf: no arrows and no bar, the next tile peeking in at the edge, moved by a drag or a swipe. Nothing else moves it, and the tiles out of view take no focus, so Tab stops at the third tile and the keyboard never sees the rest.Rule of thumb: Make a gesture a shortcut, never the only way
- A shelf that loops without endWCAG 4.1.2 A tile cut in half at each edge, and Next that never runs out, made by putting copies of the end tiles before and after the row. The copies are hidden from screen readers but still take Tab, so Tab starts on a half tile that says nothing and runs on into copies out of sight. Take the copies out of the Tab order too, or let the shelf stop at its ends.
Verify the fix
4 checks, no mouse.
Test with: Keyboard, Screen reader, Forced colors
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.
References
- ARIA APG: carousel (opens in a new tab)
- ARIA APG: carousel-1-prev-next (opens in a new tab)
- WAI Tutorial: carousels (opens in a new tab)
- WCAG Understanding: keyboard (opens in a new tab)
- WCAG Understanding: name-role-value (opens in a new tab)
- developer.mozilla.org: aria-live (opens in a new tab)
- developer.mozilla.org: aria-current (opens in a new tab)
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.