npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@etchteam/storybook-addon-a11y-interaction-tests

v2.0.0

Published

Storybook addon for accessibility interaction tests

Downloads

149

Readme

Storybook A11y Interaction Tests

A collection of reusable accessibility interaction tests for common UI patterns that can be used in Storybook's test runner play functions.

Installation

npm install --save-dev @etchteam/storybook-addon-a11y-interaction-tests
# or
yarn add -D @etchteam/storybook-addon-a11y-interaction-tests

Usage

This addon provides a set of reusable accessibility interaction tests that you can use in your Storybook stories' play functions. The tests follow the W3C ARIA Design Patterns and test for proper ARIA roles, states, properties, and keyboard interactions.

Example Usage

import type { Meta, StoryObj } from '@storybook/react';
import { expect, userEvent } from '../utils/test-utils';
import { a11yButton } from '@etchteam/storybook-addon-a11y-interaction-tests';

import { Button } from './Button';

const meta: Meta<typeof Button> = {
  component: Button,
  argTypes: {
    // ... your argTypes
  },
};

export default meta;
type Story = StoryObj<typeof Button>;

export const Primary: Story = {
  args: {
    label: 'Button',
    primary: true,
  },
  play: async ({ canvasElement, step }) => {
    // Run the a11y button tests
    await a11yButton({
      step,
      canvasElement,
      isDisabled: false,
      isToggle: false,
    });
    
    // Add any additional tests specific to your button component
  },
};

export const Disabled: Story = {
  args: {
    label: 'Disabled Button',
    disabled: true,
  },
  play: async ({ canvasElement, step }) => {
    await a11yButton({
      step,
      canvasElement,
      isDisabled: true,
    });
  },
};

Using Multiple Test Patterns

You can use multiple accessibility tests for components that combine patterns:

import { a11yButton, a11yDisclosure } from '@etchteam/storybook-addon-a11y-interaction-tests';

// ...

export const DisclosureButton: Story = {
  args: {
    // ...
  },
  play: async ({ canvasElement, step }) => {
    // Test both button and disclosure aspects
    await a11yButton({ step, canvasElement });
    await a11yDisclosure({ step, canvasElement });
  },
};

Available Tests

This addon includes tests for the following ARIA patterns:

  • a11yAccordion - Tests for accordion components
  • a11yAlert - Tests for alert components
  • a11yAlertDialog - Tests for alert dialog components
  • a11yButton - Tests for button components
  • a11yCarousel - Tests for carousel components
  • a11yCheckbox - Tests for checkbox components
  • a11yCombobox - Tests for combobox components
  • a11yDisclosure - Tests for disclosure components
  • a11yLink - Tests for link components
  • a11yModal - Tests for modal dialog components
  • a11yRadio - Tests for radio button components
  • a11ySwitch - Tests for switch components
  • a11yTable - Tests for table components
  • a11yTabs - Tests for tabs components

Each test function accepts parameters specific to that component type.

License

MIT