Skip to content

add custom ARIA announcement options to Toaster component - #765

Open
wakki0202 wants to merge 4 commits into
emilkowalski:mainfrom
wakki0202:feat/toast-aria-announcement-options
Open

add custom ARIA announcement options to Toaster component#765
wakki0202 wants to merge 4 commits into
emilkowalski:mainfrom
wakki0202:feat/toast-aria-announcement-options

Conversation

@wakki0202

Copy link
Copy Markdown

You can use this as the PR description:

Summary

This change makes aria-live, aria-atomic, and aria-relevant configurable per toast.

This allows screen reader announcement behavior to be adjusted based on the type of notification. For example, error messages and other urgent notifications can now be announced with higher priority instead of always using a fixed polite setting.

Background

Previously, announcement behavior was effectively fixed, and in particular aria-live was always treated as polite.

While this is reasonable for general notifications, it is not sufficient for cases like error messages or critical alerts where the content should be conveyed more urgently to the user.

From an accessibility perspective, different kinds of toast notifications should be able to control how and when they are announced by assistive technologies.

Changes

  • Added support for configuring aria-live per toast
  • Added support for configuring aria-atomic per toast
  • Added support for configuring aria-relevant per toast
  • Enabled toast-level control over how announcements are delivered to screen readers

Motivation

Some notifications, such as error messages, need to be announced with urgency.

With this change, toast notifications can provide more appropriate ARIA semantics depending on their purpose, which improves accessibility and gives consumers more control over screen reader behavior.

Example

For example, informational messages can continue using polite, while error notifications can use assertive so they are announced more immediately.

If you want, I can also make this shorter and more GitHub-native, or rewrite it in a more formal OSS project style.

@vercel

vercel Bot commented Jun 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sonner Error Error Jun 7, 2026 12:18pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant