Ir al contenido principal
Skip to docs content

Storybook Screen Reader Addon

The Speakable Storybook addon predicts screen reader output for every component story in real time. See what NVDA, JAWS, VoiceOver, and Narrator would announce without leaving your component development workflow. Catch accessibility issues while you build, not after you ship.

Speakable Storybook addon showing predicted NVDA screen reader output for a form component with checkboxes, radio buttons, and text inputs
The Speakable addon panel in Storybook, showing predicted NVDA output for a form with mixed states.

What the Addon Shows You

The addon adds a "Screen Readers" panel to Storybook. When you render any story, it instantly shows predicted speech output for four screen readers, plus an accessibility audit.

Per-Reader Predictions

Separate tabs for NVDA, JAWS, VoiceOver, and Narrator. Each produces genuinely different output reflecting how that reader handles roles, states, and announcement order.

Live Updates on Interaction

Click a button, expand a dropdown, or toggle a checkbox in your story. The predicted output updates immediately to reflect the new ARIA states.

Accessibility Audit

The Audit tab flags missing accessible names, heading hierarchy violations, and unnamed landmarks with severity levels and suggestions.

Element Statistics

A stats bar shows total elements, interactive elements, landmarks, and headings for quick structural awareness.

How Screen Reader Output Differs Per Reader

The addon uses the same Speakable engine that powers the CLI and MCP server. Each reader produces genuinely differentiated output. Here are some common differences you will see across tabs:

ElementNVDAJAWSVoiceOverNarrator
LinkHome, linkHome, clickableHome, linklink, Home
HeadingWelcome, heading level 1Welcome, heading 1heading level 1, WelcomeHeading level 1, Welcome
NavigationMain, navigation landmarkMain, navigation regionnavigation, Mainnavigation, Main
ImageLogo, graphicLogo, graphicLogo, imageLogo, image
Disabled buttonSave, button, unavailableSave, button, unavailableSave, button, dimmedSave, button, disabled
Checkbox (unchecked)Accept, checkbox, not checkedAccept, check box, not checkedAccept, checkbox, uncheckedAccept, check box, unchecked

How to Install the Storybook Addon

The addon ships as part of the @reticular/speakable package. No extra package to install. If you already use Speakable for CLI or MCP, you have the addon ready.

Step 1: Install Speakable

If you have not installed Speakable yet:

Terminal
npm install --save-dev @reticular/speakable

Step 2: Add to Storybook Config

Add the addon to your .storybook/main.ts (or .storybook/main.js):

.storybook/main.ts
import type { StorybookConfig } from '@storybook/your-framework';

const config: StorybookConfig = {
  stories: ['../src/**/*.stories.@(js|ts|tsx)'],
  addons: [
    '@storybook/addon-essentials',
    '@reticular/speakable/storybook', // Add this line
  ],
  framework: '@storybook/react-vite', // or your framework
};

export default config;

Step 3: Start Storybook

Start Storybook as usual. The "Screen Readers" panel appears at the bottom alongside your other addon panels (Actions, Controls, etc.):

Terminal
npm run storybook

No configuration required beyond adding it to your addons array. The addon automatically analyzes every rendered story.

How the Addon Works Under the Hood

1.

A Storybook decorator wraps every story. After each render, it captures the story's live DOM.

2.

The core Speakable engine builds an accessibility tree from the DOM: roles, names, states, values, and hierarchy.

3.

Four separate renderers produce output for NVDA, JAWS, VoiceOver, and Narrator, each with its own announcement order, role vocabulary, and state phrasing.

4.

A MutationObserver watches for DOM changes (attribute mutations on ARIA states, child additions/removals). When the component updates, predictions refresh automatically.

5.

The audit engine runs concurrently, checking heading hierarchy, landmark structure, and interactive elements for missing accessible names.

Supported Frameworks

The addon works with any Storybook framework that renders to the DOM. The analysis runs on the final rendered HTML, so it is framework-agnostic:

@storybook/react-vite
@storybook/react-webpack5
@storybook/vue3-vite
@storybook/svelte-vite
@storybook/html-vite
@storybook/web-components-vite

Requires Storybook 8.x. The addon uses the Storybook Manager API and panel registration system introduced in Storybook 7, but is tested and optimized for version 8.

Using the Addon with Storybook Controls

Combine the addon with Storybook Controls to explore how prop changes affect screen reader output. For example, toggling a disabled prop will show the reader output update from "button" to "button, unavailable" (NVDA) or "button, dimmed" (VoiceOver) in real time.

Tip: Write stories that isolate specific ARIA patterns. A story for "Button expanded" and another for "Button collapsed" makes cross-reader differences immediately obvious without needing to interact.

Understanding the Audit Tab

The Audit tab runs a lightweight accessibility check on the rendered story. It reports issues that would affect screen reader users:

Error

Missing accessible name on interactive elements (buttons, links, inputs without labels)

Warning

Heading hierarchy violations (skipped levels), unnamed landmarks

Info

No landmarks found (consider adding semantic structure)

The audit runs the same checks as the CLI audit command and the MCP audit_html tool.

Speakable Addon vs @storybook/addon-a11y

Both addons help with accessibility, but they solve different problems and work well together:

AspectSpeakable Addon@storybook/addon-a11y
FocusScreen reader output predictionWCAG rule violations (via axe-core)
OutputWhat users hear, per readerPass/fail rule results
Best forVerifying announcement quality and contentCatching WCAG compliance issues
Reader differencesYes (4 readers with distinct output)No (generic rule-based)
Use together?Yes. Use both for comprehensive coverage.

Limitations and Accuracy

The addon provides heuristic predictions, not a screen reader emulator. Keep these limitations in mind:

  • Predictions approximate common screen reader behavior. Real output varies by reader version, user settings, and verbosity level.
  • Dynamic focus management (focus trapping, focus restore) is not fully modeled. The addon shows the DOM state, not the focus sequence.
  • Live region announcements are shown as static output. The timing and interruption behavior of live regions differs across readers.
  • CSS-based hiding (display: none, visibility: hidden) is detected, but complex CSS state transitions may not be captured on initial render.

Always verify with real screen readers before release. The addon is a development-time tool for catching obvious issues and understanding cross-reader differences. It does not replace testing with NVDA, JAWS, VoiceOver, or Narrator on actual devices.

Related Pages