Back to integrations
Add your integration
  • ⭐️ Popular
  • 🧩 Essentials
  • 🛠 Code
  • ⚡️ Data & state
  • ✅ Test
  • 💅 Style
  • 🎨 Design
  • ⚙️ Appearance
  • 🗄 Organize
How to install addons Create an addon
Stylesheet Toggle
A Storybook addon for toggling between stylesheets.
npm install @flightstats/storybook-stylesheet-toggle
Last updated over 1 year ago
Downloads per week
Readme View on GitHub

Storybook Stylesheet Toggle

A simple addon for Storybook that allows you to define a set of stylesheets that can be toggled between. This may be useful if your project has multiple themes, or if you want to stress test your components in different styling environments.

Getting started

yarn add -D storybook-stylesheet-toggle

Install the addon in .storybook/main.js:

module.exports = {
  addons: ["storybook-stylesheet-toggle"],

Add the following configuration to .storybook/preview.js:

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

  stylesheetToggle: {
    stylesheets: [
        id: 'first',
        title: 'First stylesheet',
        url: 'path/to/first-sheet.css',
        id: 'second',
        title: 'Second stylesheet',
        url: 'path/to/second-sheet.css',

Ensure the path to your stylesheets is being served by Storybook (with the -s ./path parameter.)

Boot Storybook, and you should now see a paintbrush menu, allowing you to toggle between the stylesheets you've configured. The first stylesheet will be applied by default.

Join the community
6,616 developers and counting
WhyWhy StorybookComponent-driven UI
CommunityAddonsGet involvedBlog
ShowcaseExploreProjectsComponent glossary
Open source software

Maintained by
Special thanks to Netlify and CircleCI