storybook addon that provides a configurable theme selector

View on Github

Storybook theme addon

Notice

Only support storybook 5.x and newer.

Installation

npm i @inki/storybook-addon-theme --dev

Add to .storybook/addons.js

import '@inki/storybook-addon-theme/register';

Usage

.storybook/config.js


import { addParameters } from '@storybook/vue';

const themes = [
    {
      label: "Chalk",
      value: 'chalk'
    },
    {
      label: "Dark",
      value: "dark"
    }
];

addParameters({ 
  themes: {
    items: themes,
    // optional: set the initial active theme
    active: themes[0].value,
    // optional: set the icon used in the toolbar
    icon: 'document'
  }
});