storybook-multi-toolbar
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

storybook-multi-toolbar

Storybook addon to define multiple toggleable toolbar items.

Storybook multi toolbar screenshot

Setup

npm install --save-dev storybook-multi-toolbar

Register addon in .storybook/main.js

module.exports = {
  // ...
  addons: [
    'storybook-multi-toolbar',
    // ...
  ],
};

Define menu items .storybook/preview.js

export const parameters = {
  multiToolbar: {
    toolbars: [
      {
        param: 'features',
        name: 'Features',
        lists: [
          // toggleable menu items
          {
            type: 'toggle',
            title: 'Toggle features',
            items: [
              { param: 'firstFeature', title: 'First feature' },
              { param: 'secondFeature', title: 'Second feature' },
              { param: 'thirdFeature', title: 'Third feature' },
            ],
          },
          // normal menu items
          {
            title: 'Locale',
            param: 'locale',
            items: [
              { value: 'en', right: '🇺🇸', title: 'English' },
              { value: 'fr', right: '🇫🇷', title: 'Français' },
              { value: 'es', right: '🇪🇸', title: 'Español' },
            ],
          },
        ],
      },
    ],
  },
};

See more examples in preview.ts and parameter structure in types.ts

Package Sidebar

Install

npm i storybook-multi-toolbar

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

25.6 kB

Total Files

12

Last publish

Collaborators

  • skarbo