This website is being built in public and is very much under construction

Accessibility Specialist (home page)

Screen reader announcements with ariaNotify

Posted:

If you've ever wrestled with live regions and their many quirks, this post is for you.

In September 2026, ariaNotify() became Baseline newly available, meaning it now works across the latest versions of all major browsers (though support differs across screen readers, as we’ll see later). While it's not a direct replacement for live regions, it offers another way to trigger screen reader announcements. In some cases, it's easier to use than a live region.

In this post, we'll look at how ariaNotify() works, how it compares to live regions, when to use each, and what I found when testing it.

A quick live region recap

In my three-part deep dive on live regions (part 1, part 2, part 3), we explored how they keep screen reader users informed of dynamic content changes, and the requirements that need to be met for them to work as expected.

If you haven't read the previous posts, here's a quick recap:

  • Live regions are areas of a page that, when their text content changes, have the updated text announced by screen readers.
  • They have different politeness settings, which determine whether an announcement interrupts the screen reader’s current output or waits until it has finished.
  • They can be created using the aria-live attribute or a live region role, such as role="status".
  • They generally need to exist in the DOM before their content is updated. An exception is role="alert", which can be announced when it's inserted into the DOM prepopulated with content.
  • If you need to announce the same message more than once, you may need to clear the live region and add the text again after a short delay.
  • If visually hidden, they must be hidden in a screen reader friendly way, such as the CSS clip method.

That's quite a lot to keep track of, and that's before taking browser and screen reader quirks into account.

What is ariaNotify()?

ariaNotify() is a JavaScript method that queues a string of text for screen readers to announce. Unlike a live region, it doesn’t depend on the DOM. The text you pass in is what gets announced, not the content of an element on the page.

Similar to live regions, the browser sends the announcement through the platform accessibility API, where screen readers pick it up and announce it to the user.

It can be called on the document:

document.ariaNotify('Hello there');

Or on a specific element:

saveButton.ariaNotify('Changes saved');

It also supports an optional priority, which works in a similar way to live region politeness settings:

// The default priority "normal", similar to aria-live="polite"
document.ariaNotify('Results filtered by type');

// Similar to aria-live="assertive"
document.ariaNotify('You are about to be signed out', { 
  priority: 'high' 
});

The differences between live regions and ariaNotify()

Live regions

  • Generally need to exist in the DOM before their content changes, with the exception of role="alert".
  • Rely on DOM changes to trigger announcements.
  • May need clearing and a short delay before inserting text again when announcing the same message repeatedly.
  • Can announce both visible text and updates that have no corresponding text on screen.

Expanding on that last point, live regions are often used to announce changes where sighted users receive a visual indication instead of a text message. For example, a small "(1)" badge might appear next to a shopping basket icon, or a loading spinner might be replaced with new content.

In these cases, developers often need a separate, visually hidden live region to communicate the update to screen reader users. This means creating and maintaining an additional DOM element, ensuring it's hidden correctly and managing its content between announcements.

ariaNotify()

  • Doesn't rely on an element existing in the DOM.
  • Can be called whenever an announcement is needed.

You don't need to create and maintain a visually hidden element, keep track of its content or clear it before the next announcement. Just call ariaNotify() with the message you want to announce.

Choosing between live regions and ariaNotify()

As I mentioned at the start, ariaNotify() isn't a replacement for live regions. There are still cases where a live region is the more appropriate choice, and others where ariaNotify() may be the simpler option.

Use a live region for visible messages

If the dynamic text you want announced is visibly displayed on the page, a live region is still a good choice.

For example, you could use role="alert" for a visible error message or role="status" for a message such as "Changes saved".

Consider ariaNotify() instead of visually hidden live regions

ariaNotify() is particularly useful when you'd normally use a visually hidden live region. This is often the case when the design or interaction doesn't allow for a text message to be displayed, but sighted users receive some other visual indication of the change.

For example, you might announce "Results loaded" when a loading spinner is replaced with search results, or "Added to basket, basket contains 3 items" when a badge next to the basket icon updates.

Using ariaNotify() in these situations removes the need to maintain a separate live region in the DOM, keep it visually hidden and clear its content between announcements.

Example: searching for train tickets

Let's revisit the train ticket example from part 1 of my live regions series. The user presses the search button, a loading spinner appears, and the results are then displayed.

Using a live region

With a visually hidden live region, we might do something like this (simplified example):

<!-- Present on page load, visually hidden with CSS -->
<div role="status" class="visually-hidden" id="search-status"></div>
const status = document.getElementById('search-status');

// When search button pressed
status.textContent = 'Searching for tickets';

// When results returned
status.textContent = `${results.length} tickets found`;

// Clear the live region after a short delay
setTimeout(() => {
  status.textContent = '';
}, 5000);

The live region needs to exist on the page before it's used, have its text content dynamically updated, be visually hidden with CSS, and be cleared after use.

Clearing the live region isn't always necessary, but it can help avoid leaving visually hidden text scattered around the page. If screen reader users encounter this text later, it may be confusing without the context of the original announcement.

Using ariaNotify()

With ariaNotify(), we can achieve the same result with much less code:

// When search button pressed
document.ariaNotify('Searching for tickets');

// When results returned
document.ariaNotify(`${results.length} tickets found`);

There's no markup, no CSS, no visually hidden DOM node, and nothing to clear.

When not to use either

Live regions and ariaNotify() are both for announcing dynamic changes that screen reader users might otherwise miss.

As I covered in part 1 and part 3, there are many situations where neither is needed, as the change is already communicated in other ways:

  • Disclosures and other expanding content, like dropdown buttons and accordions, should use aria-expanded, or accessible native alternatives like <details>.
  • Toggle buttons should use aria-pressed.
  • Content that receives keyboard focus will usually be announced automatically.
  • Content that's already available when the page loads can usually be discovered through normal screen reader navigation.

Using ariaNotify()

There are a few things to consider when using ariaNotify(), particularly around priority, how announcements are handled and support for older browsers.

Priority

ariaNotify() supports two priority values:

  • normal (default): the announcement waits until the screen reader has finished its current output. Roughly equivalent to aria-live="polite".
  • high: the announcement is made immediately, interrupting the current output. Roughly equivalent to aria-live="assertive".

The same advice applies as with live regions. Use normal for most announcements, and only use high for critical, time-sensitive information. Interrupting users unnecessarily can be disorientating.

Combine messages

If you need to announce more than one thing at the same time, combine them into a single announcement.

Some screen readers will read multiple ariaNotify() calls in order, but this isn't guaranteed. In my testing, I found that usually only the most recent one is spoken.

Don't: fire several announcements at once

document.ariaNotify('Item added to basket.');
document.ariaNotify('Basket contains 3 items.');

Do: combine them into one announcement

document.ariaNotify('Item added to basket, basket contains 3 items.');

Permissions policy

The aria-notify Permissions Policy controls whether ariaNotify() is available in a document or an embedded <iframe>.

If the policy blocks it, calls to ariaNotify() will be ignored and fail silently. Nothing will be announced, and you won't get an error or warning to tell you that the call has been blocked.

This is something to be aware of if you're embedding content on another website, or allowing your own content to be embedded elsewhere. The Permissions Policy set by the parent page may prevent ariaNotify() from working.

Supporting older browsers

As ariaNotify() only became Baseline in September 2026, it's only supported in the latest browser versions. If you need to support older browsers, you can check for ariaNotify() support and fall back to live regions, as shown in the example below.

First, create the fallback live regions. These need to be present on the page from the start:

<!-- Fallback live regions, present on page load -->
<div 
  id="announcer-polite" 
  class="visually-hidden" 
  aria-live="polite" 
  aria-atomic="true"
></div>
<div 
  id="announcer-assertive" 
  class="visually-hidden" 
  aria-live="assertive" 
  aria-atomic="true"
></div>

Then, you can use a helper function to handle the announcement:

// Example code, not production ready
function announce(message, assertive = false) {
  if ('ariaNotify' in document) {
    // Modern browsers
    document.ariaNotify(message, {
      priority: assertive ? 'high' : 'normal',
    });
  } else {
    // Fallback to live region announcement
    const liveRegionId = assertive 
      ? 'announcer-assertive' 
      : 'announcer-polite';

    const liveRegion = document.getElementById(liveRegionId);
    if (!liveRegion) return;

    liveRegion.textContent = '';

    setTimeout(() => {
      liveRegion.textContent = message;
    }, 150);
  }
}

// Normal priority announcement
announce('Changes saved');

// High priority announcement
announce('You are about to be signed out', true);

This is a simplified example. In production, you'd need to account for repeated announcements and overlapping calls to the helper, particularly when clearing and updating the live region.

When you no longer need to support older browsers, the fallback can be removed in one place.

ariaNotify() behaviour and testing

While ariaNotify() offers a simpler way to trigger announcements, there are a few behaviours worth knowing about.

The following observations are based on my own testing with VoiceOver/Safari (macOS), NVDA/Firefox (Windows 11), and JAWS/Edge (Windows 11).

Hidden elements

Calling element.ariaNotify() on an element that's hidden from the accessibility tree produces no announcement.

This includes elements hidden using:

  • display: none
  • visibility: hidden
  • The hidden attribute
  • aria-hidden="true"

There's no error or warning either. The ariaNotify() call fails silently.

Language

Both methods are meant to use the lang attribute to determine the voice used for the announcement, but they look in different places:

  • document.ariaNotify() uses the lang attribute on the <html> element, or the user agent's default language if no lang attribute is set.
  • element.ariaNotify() uses the lang attribute on the element itself or, if it doesn't have one, the nearest ancestor with a lang attribute.

In testing, I couldn't get either method to use the correct voice or pronunciation when announcing non-English text.

For example, with <html lang="fr"> and document.ariaNotify() using some French text, screen readers still used an English voice and pronunciation.

element.ariaNotify() behaved the same way, regardless of whether lang was set on the element, an ancestor or both. Changing the voice settings made no difference either.

For comparison, JAWS and VoiceOver both announced the same French text inside a live region using the correct voice and pronunciation. NVDA didn’t, regardless of settings or speech synthesizer. Based on my testing, language support for ariaNotify() still has some catching up to do.

Priority of live regions over ariaNotify()

According to MDN, live region announcements take priority over ariaNotify() announcements. So if a live region and an ariaNotify() call fire at the same time, the live region should be announced first.

However, in my testing, when triggering a live region update and an ariaNotify() call simultaneously, the order of announcements differed across screen readers.

VoiceOver (Safari)

  • Text in aria-live="assertive" regions and role="alert" elements was announced, but text passed to ariaNotify() was not, regardless of its priority value.
  • Text passed to ariaNotify() was announced before text in aria-live="polite" regions and role="status" elements, regardless of its priority value.

NVDA (Firefox)

  • Text in live regions (all types) was announced before text passed to ariaNotify(), regardless of its priority value.
  • Text passed to ariaNotify() was announced immediately after the live region text.

JAWS (Edge)

  • Text passed to ariaNotify() was announced before text in all types of live regions, regardless of its priority value.

Conclusion

ariaNotify() offers another way to make screen reader announcements, and can remove a lot of the extra work involved with visually hidden live regions. Just bear in mind support is still catching up and not everything works as expected across different screen readers.

When deciding between a live region and ariaNotify():

  • Ask yourself if an announcement is needed at all.
  • If the message is visible on the page as text, use a live region.
  • If you'd otherwise use a visually hidden live region, consider ariaNotify() instead.
  • If you need to support older browsers, use a live region fallback.

Whichever you choose, test across different browser and screen reader combinations, ideally with native screen reader users.

Further reading