Course contentsShow
← Web Development
Lesson 1034 of 2,98218. Accessibility FundamentalsFree lesson

ARIA for Dynamic Content Changes

Use aria-live, aria-atomic, and aria-relevant to announce dynamic content updates to screen readers.

ARIA for Dynamic Content Changes

You'll learn how to make real-time content updates announced to screen-reader users using ARIA live regions.

Why This Matters

When content on your page changes dynamically—like a notification popping up, a chat message arriving, or a status updating—sighted users see it immediately. Screen-reader users, however, might miss these changes entirely unless you explicitly tell their assistive technology to announce them.

The Three Key Attributes

You combine three ARIA attributes to control how dynamic changes are announced:

aria-live sets the urgency level:

  • off – changes aren't announced (default)
  • polite – announces when the screen reader finishes its current task
  • assertive – interrupts immediately (use sparingly!)

aria-atomic controls what gets announced:

  • false – only the changed portion is read (default)
  • true – the entire region is re-announced

aria-relevant specifies which changes matter:

  • additions – new content announced
  • removals – deleted content announced
  • text – text changes announced
  • all – everything announced
  • Default is additions text

Practical Example

<!-- Status message that updates politely -->
<div role="status" aria-live="polite" aria-atomic="true">
  File uploaded successfully
</div>

<!-- Alert that interrupts immediately -->
<div role="alert" aria-live="assertive" aria-atomic="true">
  Error: Connection lost
</div>

<!-- Chat log announcing only new messages -->
<div aria-live="polite" aria-atomic="false" aria-relevant="additions">
  <p>Alice: Hello!</p>
  <!-- New messages appear here -->
</div>

Think of aria-live regions like a news ticker: polite waits for a natural break, while assertive is like breaking news that interrupts everything.

Key Takeaway: Use aria-live, aria-atomic, and aria-relevant together to ensure screen readers announce dynamic content changes at the right time, with the right amount of information.