storybook-addon-theme-switcher
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

Storybook Addon Theme Switcher (CSS/data-*)

Storybook addon to switch css theme with the help of HTML data attribute

demo of addon

Installation

npm i -D storybook-addon-theme-switcher

Getting started

Activate the addon by adding it to main.js

module.exports = {
  addons: [
    // ...
    "storybook-addon-theme-switcher",
    // ...
  ],
};

Configuration

You can configure the themes and data attribute name in preview.js:

export const parameters = {
  themeSwitcher: {
    themes: ["psychedelic", "dark"],
    dataAttribute: "tema", // This results in data-tema
  },
};

Dependencies (0)

    Dev Dependencies (19)

    Package Sidebar

    Install

    npm i storybook-addon-theme-switcher

    Weekly Downloads

    218

    Version

    0.0.5

    License

    MIT

    Unpacked Size

    20 kB

    Total Files

    26

    Last publish

    Collaborators

    • kentare