Skip to content

feat: announce live-region package #5872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

thiessenp-cds
Copy link
Contributor

@thiessenp-cds thiessenp-cds commented Jul 11, 2025

Summary | Résumé

This package adds a util to help announce dynamic page updates in either a polite or assertive ARIA Live Region. The idea is to 1) have a live-region that is primed (in the DOM tree long before being used), and 2) make it convenient to announce a live region in any client workflow.

To use first add the <Announce /> component ideally in a component near the root of the app. Another way is by calling the hook useAnnounce() anywhere in the app. This will add the live region to the root of document.

Then to announce a dynamic update from any client context call announce(YOUR_MESSAGE). Or for an assertive message call announce(YOUR_MESSAGE, Priority.HIGH).

Test

To test the announce live region is updating fire up any screen reader and make sure announce(YOUR_MESSAGE) is being announced. Another way is to check the content in the live region e.g. for a polite announcement document.querySelector("[data-testid='gc-announce-polite']").textContent;

@github-actions github-actions bot added the !! Package Update !! Please ensure packages are built and pushed label Jul 11, 2025
Copy link
Contributor

@thiessenp-cds thiessenp-cds marked this pull request as ready for review July 11, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!! Package Update !! Please ensure packages are built and pushed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant