Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

storybook-addon-aria-live

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storybook-addon-aria-live

Inspect announcements of ARIA live regions

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Storybook Addon Aria Live

version

Storybook addon for inspecting ARIA live region announcements

storybook-addon-aria-live is a Storybook addon for inspecting ARIA live region announcements. Internally it is utilizing aria-live-capture for announcement detection.

Test online

Installation

storybook-addon-aria-live should be included in development dependencies.

npm install --dev storybook-addon-aria-live

In your .storybook/main.ts:

const config: StorybookConfig = {
  addons: ['storybook-addon-aria-live']
}

Use Storybook parameters to set global or story specific options:

In your .storybook/preview.ts:

export const parameters = {
  'aria-live': {
    /** Indicates whether live regions inside `ShadowRoot`s should be tracked. Defaults to false. */
    includeShadowDom: true,
  },
};

Development

Project setup is based on storybookjs/addon-kit. See its README for instructions about tooling.

Troubleshooting

  1. Error: Storybook preview hooks can only be called inside decorators and story functions

This is caused by storybookjs/storybook#9893. There are some work-arounds available:

  • If you have custom decorators which are rendering Story as React Element, change it to call story instead.
// preview.js

export const decorators = [
  function withCustomDecorator(Story) {
-    return <Story />;
+    return Story();
  }
]
  • If you have you have no custom decorators it is likely that 3rd party addon is causing this issue. If such addon is identified, make sure to report the issue to projects. As work-around try reordering your addons in main.js:
// main.js

module.exports = {
  addons: [
+    'some-addon-using-stories-as-react-elements-instead-of-functions',
    'storybook-addon-aria-live',
-    'some-addon-using-stories-as-react-elements-instead-of-functions',
  ],
};

Keywords

FAQs

Package last updated on 12 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc