aria-atomic — Defining Live Region Update Scope
In this tutorial, you will learn about aria. We cover key concepts, practical examples, and best practices to help you master this topic.
aria-atomic specifies whether a live region should announce all content or only the changed parts when updates occur, with true meaning the entire region is announced as a whole.
In this tutorial, you'll learn how aria-atomic controls live region announcements in your ARIA implementations.
What You'll Learn
By the end of this lesson, you'll understand when to use aria-atomic, how it interacts with aria-live, the difference between atomic and non-atomic regions, and how to test the behavior.
Why It Matters
Without aria-atomic, screen readers only announce the specific element that changed. For some widgets, users need the full context of the region to understand the update.
Real-World Use
Durga Antivirus Pro's threat dashboard uses aria-atomic="true" on the summary region so users hear the full totals when any individual count changes.
Atomic vs Non-Atomic
flowchart TD
A[Content changes in live region] --> B{aria-atomic='true'?}
B -->|Yes| C[Announce entire region content]
B -->|No, default| D[Announce only changed element]
C --> E[User hears full context]
D --> F[User hears only the delta]
How aria-atomic Works
aria-atomic is used inside an aria-live region. When set to true, screen readers announce the entire content of the live region, not just the element that changed:
<div aria-live="polite" aria-atomic="true" id="scan-summary">
<span id="files-scanned">45 files scanned</span>
<span id="threats-found">2 threats found</span>
</div>
When files-scanned updates from "45 files scanned" to "50 files scanned", the screen reader announces the full region: "45 files scanned. 2 threats found."
Without aria-atomic, it would only announce "50 files scanned" without the threats context.
When to Use aria-atomic="true"
Use aria-atomic when individual changes do not make sense in isolation:
<div aria-live="polite" aria-atomic="true" class="scoreboard">
<span class="score" id="home-score">Home: 3</span>
<span class="score" id="guest-score">Guest: 2</span>
<span class="period" id="period">Period: 2</span>
</div>
If the home score changes to 4, the user hears the full scoreboard, confirming the guest score did not change.
When to Use aria-atomic="false" (Default)
The default is false. This is correct for regions where each update is meaningful independently:
<div aria-live="polite" id="chat-log">
<!-- Each new message is independent -->
</div>
Common Mistakes
- Using aria-atomic="true" on regions with many elements: The user must listen to the entire region for every change.
- Forgetting to set aria-live: aria-atomic has no effect without aria-live or a live region role.
- Setting aria-atomic on nested elements: aria-atomic only affects the element it is on, not ancestors.
- Using aria-atomic with assertive live regions: The combination can be overwhelming for users.
- Not testing with actual screen readers: Different screen readers handle aria-atomic slightly differently.
Practice and Challenge
1. What does aria-atomic="true" do? Causes the entire live region to be announced when any part of it changes.
2. What is the default value of aria-atomic? false.
3. When should you use aria-atomic="true"? When individual changes need full context to be understood.
4. How does aria-atomic interact with aria-live? aria-atomic modifies how the live region announces changes, but aria-live must be present.
5. Challenge: Create a live region showing scan statistics with aria-atomic="true". Update one counter and verify the full region announcement.
FAQ
Mini Project
Build a shopping cart widget where the total price and item count are in a live region with aria-atomic="true". Update the item count and verify the full total is announced.
What's Next
Continue to aria-relevant to learn how to control which live region changes are announced.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro