jeffreytse/grimoire-core/apply-aria-live-regions

Claude Code and agent skill by jeffreytse/grimoire-core

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when adding dynamic content that changes without a user-triggered focus move — toast notifications, search results loading, form submission status, chat messages, or any async UI update — so screen reader users are informed of the change.

Install

npx vskill@latest install jeffreytse/grimoire-core/apply-aria-live-regions

SKILL.md

The same SKILL.md was published earlier as jeffreytse/grimoire-core/apply-aria-live-regions.

Apply ARIA Live Regions

Announce dynamic content changes to screen readers using aria-live regions or semantic live region roles — without moving focus.

Why This Is Best Practice

Adopted by: WCAG 2.1 SC 4.1.3 (Level AA) is required by Section 508 (US), EU EN 301 549, and UK PSBAR 2018. WAI-ARIA 1.2 live region support is implemented in all major screen readers (NVDA, JAWS, VoiceOver, TalkBack) since 2018. All major front-end frameworks (React, Angular, Vue) have accessibility guidance on live regions for dynamic content. Impact: Deque Systems research found that missing live region announcements are the

#2 source of screen reader usability failures in single-page applications, after focus management. A screen reader user who submits a form and hears nothing cannot know if the submission succeeded, failed, or is loading — without a live region announcement, they must explore the page manually to find out. Why best: The alternative — moving focus to the new content — is disruptive for minor status updates (toast notifications, inline search suggestions). Live regions allow content to be announced without stealing focus, preserving the user's context and interaction flow.

Sources: W3C WCAG 2.1 SC 4.1.3 (2018); WAI-ARIA 1.2 Live Region specification; Deque University; MDN ARIA live regions

Steps

Step 1: Choose the right live region role for the urgency level
Role / attributeUrgencyInterrupts?Use for
role="status" / aria-live="polite"LowNo — waits for user to finishSuccess messages, loading complete, search result count
role="alert" / aria-live="assertive"HighYes — announces immediatelyErrors, warnings, time-sensitive messages
role="log"LowNoChat history, activity feeds
role="timer"LowNoCountdown timers
aria-live="off"NoneNoDisable announcements on a region

Use polite by default. Only use assertive for critical errors or urgent warnings — interrupting a screen reader user mid-sentence is disruptive.

Step 2: Place the live region in the DOM before content is injected
html
<!-- Wrong — role="alert" added dynamically; browser may not register it -->
<script>
const el = document.createElement('div');
el.setAttribute('role', 'alert');
el.textContent = 'Error: invalid email';
document.body.appendChild(el);
</script>
<!-- Right — live region exists in DOM at page load; content is injected later -->
<div role="status" id="toast-region" aria-live="polite" aria-atomic="true"></div>
<script>
document.getElementById('toast-region').textContent = 'Profile saved successfully';
</script>

The live region container must be present in the DOM before the announcement. Dynamically creating the element and adding content simultaneously is unreliable.

Step 3: Use aria-atomic to control how changes are announced
html
<!-- aria-atomic="true" — entire region announced when any part changes -->
<div role="status" aria-live="polite" aria-atomic="true">
Showing 24 of 847 results
</div>
<!-- aria-atomic="false" (default) — only changed parts announced -->
<div role="log" aria-live="polite" aria-atomic="false">
<!-- Individual messages appended; each appended message announced -->
<p>Alice joined the chat</p>
<p>Bob sent a message</p>
</div>

For status messages with a single changing value (result count, progress), use aria-atomic="true". For append-only logs (chat, notifications), use the default aria-atomic="false".

Step 4: Common live region patterns

Toast notification:

html
<div id="toast" role="status" aria-live="polite" aria-atomic="true"
class="toast" hidden></div>
<script>
function showToast(message) {
const toast = document.getElementById('toast');
toast.textContent = ''; // clear first to re-trigger announcement
toast.removeAttribute('hidden');
requestAnimationFrame(() => { // allow DOM update before setting content
toast.textContent = message;
});
setTimeout(() => toast.setAttribute('hidden', ''), 4000);
}
showToast('Your order has been placed.');
</script>

Loading state:

html
<div role="status" aria-live="polite" id="loading-status"></div>
<script>
function setLoading(isLoading) {
const status = document.getElementById('loading-status');
status.textContent = isLoading ? 'Loading results…' : 'Results loaded';
}
</script>

Search result count:

html
<p role="status" aria-live="polite" aria-atomic="true" id="result-count"></p>
<script>
function updateResultCount(count) {
document.getElementById('result-count').textContent =
count === 0 ? 'No results found' : `${count} results found`;
}
</script>
Step 5: Test announcements with a real screen reader
  • Enable NVDA (Windows) or VoiceOver (macOS/iOS)
  • Trigger the dynamic update
  • Verify the announcement is made without focus moving
  • Verify assertive announcements interrupt current speech
  • Verify polite announcements wait for a speech pause

When NOT to Use

  • Content that takes focus anyway — if the user action opens a modal or navigates to a new page, focus management handles the announcement. No live region needed.
  • Every change in the DOM — overusing aria-live creates announcement noise. Only announce changes users need to know about without actively exploring the page.

Common Mistakes

Adding `role="alert"` to an element and content simultaneously. Some screen readers don't catch this. Pre-render the live region; inject content after.

Using `aria-live="assertive"` for non-urgent messages. Assertive interrupts whatever the screen reader is saying. Use polite for success messages, counts, loading states.

Clearing live region content immediately. If you clear and refill the region in the same tick, some screen readers announce nothing. Use requestAnimationFrame or a brief setTimeout between clear and fill.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jeffreytse/grimoire-core/apply-aria-live-regions/badge)](https://verified-skill.com/skills/jeffreytse/grimoire-core/apply-aria-live-regions)

Something wrong with this skill or its page? Tell us.