Course contentsShow
← Web Development
Lesson 1191 of 2,98221. Accessible ComponentsFree lesson

Screen Reader Announcements for Slide Changes

Use aria-live regions to announce current slide number and total when navigation occurs.

Screen Reader Announcements for Slide Changes

You'll learn how to make carousels communicate slide changes to screen reader users in real-time.

The Problem

When a sighted user navigates a carousel, they immediately see the new slide appear. But screen reader users receive no notification that content changed unless you explicitly announce it. Without announcements, they might not realize the navigation buttons worked at all.

Using ARIA Live Regions

The solution is aria-live regions—special areas that screen readers monitor for updates. When you change slides, you update text inside this region, and the screen reader announces it automatically.

Basic Pattern

Create a visually hidden element with aria-live="polite":

<div class="carousel">
  <div class="visually-hidden" aria-live="polite" aria-atomic="true">
    <!-- Announcement text goes here -->
  </div>
  
  <div class="slides">
    <!-- Your slides -->
  </div>
</div>

Announcing the Change

When the user navigates, update the live region with the current slide information:

function updateSlide(currentIndex, totalSlides) {
  const announcement = `Slide ${currentIndex + 1} of ${totalSlides}`;
  document.querySelector('[aria-live]').textContent = announcement;
}

Why This Matters

Think of it like a tour guide calling out stops: "Now arriving at stop 3 of 5." Screen reader users need the same orientation information that visual users get automatically. Using aria-atomic="true" ensures the entire message is read, not just the changed part.

Key Takeaway: Use a visually hidden aria-live="polite" region to announce slide numbers when navigation occurs, giving screen reader users the same awareness of position that sighted users receive visually.