Skip to content

fix(Snackbar): add urgent prop to switch live-region role to alert (closes #615)#624

Open
sridhar-3009 wants to merge 2 commits into
vuetifyjs:masterfrom
sridhar-3009:fix/snackbar-alert-role-615
Open

fix(Snackbar): add urgent prop to switch live-region role to alert (closes #615)#624
sridhar-3009 wants to merge 2 commits into
vuetifyjs:masterfrom
sridhar-3009:fix/snackbar-alert-role-615

Conversation

@sridhar-3009

Copy link
Copy Markdown
Contributor

Summary

  • Adds an urgent boolean prop to SnackbarRoot that switches the ARIA live-region role from 'status' to 'alert' when set to true
  • Previously role was hardcoded to 'status', making it impossible to signal urgency to assistive technologies at the component level
  • Addresses WCAG 4.1.3 (Status Messages): urgent notifications now use role="alert" (assertive live region) while informational ones keep role="status" (polite live region)

Changed file

packages/0/src/components/Snackbar/SnackbarRoot.vue

  • SnackbarRootProps — new optional urgent?: boolean prop (JSDoc included)
  • defineProps destructure — urgent added
  • slotProps computed — role: urgent ? 'alert' : 'status'

Test plan

  • Render <SnackbarRoot> without urgent — verify rendered element has role="status"
  • Render <SnackbarRoot urgent> — verify rendered element has role="alert"
  • Run existing Snackbar unit tests to confirm no regressions
  • Smoke-test with a screen reader: urgent snackbar should interrupt; non-urgent should wait for idle

…loses vuetifyjs#615)

Previously the live-region role was hardcoded to 'status', giving no way to
signal urgency to assistive technologies. Add an `urgent` boolean prop on
SnackbarRoot that switches the rendered role to 'alert' when true, satisfying
WCAG 4.1.3 (Status Messages) for time-sensitive notifications.
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Changeset found — this change will be included in the next release. Thanks!

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

Labels

C: Snackbar T: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants