Skip to content

Storybook plugin that allows you to switch between multiple containers that are wrapped around your stories.

License

Notifications You must be signed in to change notification settings

SuoraGmbH/story-container-switcher-addon

Repository files navigation

Story Container Switcher

NPM version NPM downloads bundle size MIT license

A Storybook plugin that allows you to view your stories inside different container components like Modal, Dialog, Drawer or even better — all at once.

Demo

Live example | Example repository

storybook-addon-story-container-switcher-demo.mp4

Installation

Install the following npm module:

npm i --save-dev storybook-addon-story-container-switcher

or with yarn:

yarn add -D storybook-addon-story-container-switcher

Configuration

You need to configure the plugin before it can be used in the Storybook.

  1. Add the addon to the addons list in .storybook/main.js

    module.exports = {
        addons: [
            // all other addons
            'storybook-addon-story-container-switcher'
        ]
    };
  2. Add the parameters to the .storybook/preview.js

    export const parameters = {
      storyContainers: [
        {
          id: "modal",
          label: "Modal",
          container: YourFavoriteModal
        },
        // more containers
      ]
    }

About

Storybook plugin that allows you to switch between multiple containers that are wrapped around your stories.

Resources

License

Stars

Watchers

Forks

Packages

No packages published