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
  },
};

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.5
    230
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.5
    230
  • 0.0.4
    0
  • 0.0.3
    0
  • 0.0.2
    0

Package Sidebar

Install

npm i storybook-addon-theme-switcher

Weekly Downloads

190

Version

0.0.5

License

MIT

Unpacked Size

20 kB

Total Files

26

Last publish

Collaborators

  • kentare