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

0.1.2 • Public • Published

Storybook Addon Theme Changer

A simple addon for changing theme on Storybook. Inspired by theme-change

Animation

This addon just controls themes (for example, light and dark), just adding data-theme attribute to the html tag.

It works nicely with UI libraries such as daisyUI.

Getting Started

Add this addon to the .storybook/main.js file.

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

Add your themes to the .storybook/preview.js file

...
export const globalTypes = {
 themes: {
   defaultValue: [
     "light",
     "dark",
     ...
   ],
 },

Dependents (1)

Package Sidebar

Install

npm i storybook-addon-theme-changer

Weekly Downloads

340

Version

0.1.2

License

MIT

Unpacked Size

23.5 kB

Total Files

25

Last publish

Collaborators

  • kwatanwa17