JSPM

@storybook/addon-a11y

3.3.0-rc.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8030437
  • Score
    100M100P100Q314963F
  • License MIT

a11y addon for storybook

Package Exports

  • @storybook/addon-a11y
  • @storybook/addon-a11y/dist/index.js
  • @storybook/addon-a11y/register
  • @storybook/addon-a11y/register.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@storybook/addon-a11y) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

storybook-addon-a11y

This storybook addon can be helpfull to make your UI components more accessibile.

Getting started

First, install the addon.

$ npm install -D @storybook/addon-a11y

Add this line to your addons.js file (create this file inside your storybook config directory if needed).

import '@storybook/addon-a11y/register';

import the 'checkA11y' decorator to check your stories for violations within your components.

import React from 'react';
import { storiesOf } from '@storybook/react';

import { checkA11y } from '@storybook/addon-a11y';

storiesOf('button', module)
  .addDecorator(checkA11y)
  .add('Accessible', () => (
    <button>
      Accessible button
    </button>
  ))
  .add('Inaccessible', () => (
    <button style={{ backgroundColor: 'red', color: 'darkRed', }}>
      Inaccessible button
    </button>
  ));

Roadmap

  • Make UI accessibile
  • Add color blindness filters (Example)
  • Show in story where violations are.
  • Make it configurable
  • Add more example tests
  • Add tests
  • Make CI integration possible