Install the following npm module:
npm i --save-dev storybook-tailwind-dark-modeor with yarn:
yarn add -D storybook-tailwind-dark-modeThen, add following content to .storybook/main.js
module.exports = {
addons: ['storybook-tailwind-dark-mode']
};To set dark mode as default, Add the following lines of code to your preview.js file
export const globalTypes = {
darkMode: true,
};
