-
Notifications
You must be signed in to change notification settings - Fork 236
chore: add storybook-screen-reader plugin #5911
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
|
📚 Branch Preview Links🔍 First Generation Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
384201c to
736dcbb
Compare
| }, | ||
| "peerDependencies": { | ||
| "@lit/react": ">=1.0.0", | ||
| "@spectrum-web-components/switch": ">=1.0.0", | ||
| "@spectrum-web-components/theme": ">=1.0.0", | ||
| "@storybook/components": ">=8.0.0", | ||
| "@storybook/core-events": ">=8.0.0", | ||
| "@storybook/manager-api": ">=8.0.0", | ||
| "lit": "^2.5.0 || ^3.1.3", | ||
| "react": ">=18.0.0" | ||
| }, | ||
| "description": "A Screen Reader Storybook addon for accessibility testing", |
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.
Expected object keys to be in ascending order. 'description' should be before 'peerDependencies'.
| }, | |
| "peerDependencies": { | |
| "@lit/react": ">=1.0.0", | |
| "@spectrum-web-components/switch": ">=1.0.0", | |
| "@spectrum-web-components/theme": ">=1.0.0", | |
| "@storybook/components": ">=8.0.0", | |
| "@storybook/core-events": ">=8.0.0", | |
| "@storybook/manager-api": ">=8.0.0", | |
| "lit": "^2.5.0 || ^3.1.3", | |
| "react": ">=18.0.0" | |
| }, | |
| "description": "A Screen Reader Storybook addon for accessibility testing", | |
| }, | |
| "description": "A Screen Reader Storybook addon for accessibility testing", | |
| "peerDependencies": { | |
| "@lit/react": ">=1.0.0", | |
| "@spectrum-web-components/switch": ">=1.0.0", | |
| "@spectrum-web-components/theme": ">=1.0.0", | |
| "@storybook/components": ">=8.0.0", | |
| "@storybook/core-events": ">=8.0.0", | |
| "@storybook/manager-api": ">=8.0.0", | |
| "lit": "^2.5.0 || ^3.1.3", | |
| "react": ">=18.0.0" | |
| }, |
A Storybook addon that simulates screen reader behavior, providing instant audio and visual feedback as you navigate components.
What it does
Voice Reader: Speaks announcements using Web Speech API
Text Reader: Displays announcements in the addon panel
Tab through your component → hear/see what a screen reader would announce
How it works
Tracks focus via focusin events
Computes accessible names using dom-accessibility-api (W3C AccName spec)
Maps elements to ARIA roles via aria-query
Announces: role, name, states (checked, expanded, disabled, etc.)
Implementation
This addon is a shared local package at
2nd-gen/packages/swc/.storybook/addons/screen-reader-addon/:(.ts/.tsx)esbuildcompiles source directlysp-switch,sp-theme,sp-textfield,sp-help-text,sp-field-label1st-genand2nd-genaria-query,dom-accessibility-api,query-selector-shadow-dom) are installed in the parent packageLimitations
This is a development aid, not a replacement for real screen reader testing.
Good for: Quick feedback on accessible names, roles, and states
Not for: Final accessibility sign-off (use VoiceOver/NVDA for that)
Further Reading
See RFC for discussion on ownership, maintenance, and where this should live long-term.
Testing
Go here