New
Community Showcase #5Visual test with Chromatic
Star78,983
Back to integrations
Add your integration
Categories
  • ⭐️ Popular
  • 🧩 Essentials
  • 🛠 Code
  • ⚡️ Data & state
  • ✅ Test
  • 💅 Style
  • 🎨 Design
  • ⚙️ Appearance
  • 🗄 Organize
How to install addons Create an addon
Tailwind dark mode
Toggle stories between light and dark mode using tailwind
npm install @jhaynie/storybook-tailwind-dark-mode
Last updated over 1 year ago
4
Downloads per week
Readme View on GitHub

storybook-tailwind-dark-mode

Example

Installation

Install the following npm module:

npm i --save-dev storybook-tailwind-dark-mode

or with yarn:

yarn add -D storybook-tailwind-dark-mode

Then, add following content to .storybook/main.js

module.exports = {
  addons: ['storybook-tailwind-dark-mode']
};

Set Dark Mode as default

To set dark mode as default, Add the following lines of code to your preview.js file

export const globalTypes = {
  darkMode: true,
};
Join the community
6,194 developers and counting
WhyWhy StorybookComponent-driven UI
Open source software
Storybook

Maintained by
Chromatic
Special thanks to Netlify and CircleCI