-
Notifications
You must be signed in to change notification settings - Fork 69
fix(toast): make toast icon accessible to screen readers #3057
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: af8df03 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves accessibility for the Toast component by making the variant icon properly accessible to screen readers. Previously, the icon was hidden from assistive technology but provides important visual context about the toast type.
Key Changes
- Replaces
aria-hidden
with semantic attributes (role="img"
andaria-label
) on toast variant icons - Adds changeset documentation for the accessibility improvement
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/toast/src/InternalToast/InternalToast.tsx | Updates VariantIcon to use role="img" and aria-label instead of aria-hidden for screen reader accessibility |
.changeset/warm-groups-fly.md | Documents the accessibility improvement as a patch release |
Size Change: +26 B (0%) Total Size: 2.01 MB
ℹ️ View Unchanged
|
✍️ Proposed changes
This PR improves accessibility for the Toast component by making the variant icon properly accessible to screen readers. Previously, the icon was hidden from assistive technology using
aria-hidden
, but it provides important visual context about the toast type (success, warning, error, etc.). The change replacesaria-hidden
with appropriate semantic attributes (role="img"
andaria-label
) to ensure screen readers can announce the toast variant to users.🎟️ Jira ticket: No associated Jira ticket
✅ Checklist
pnpm changeset
and documented my changes🧪 How to test changes