Package Exports
- @storybook/addon-styling
- @storybook/addon-styling/dist/cjs/index.js
- @storybook/addon-styling/dist/esm/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@storybook/addon-styling) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@storybook/addon-styling
Get started in Storybook faster with popular styling tools.

✨ Features
- 🧩 Configuration templates for popular tools
- ⚡️ Options for css modules, postCss, and Sass
- 🎨 Provide themes
- 🔄 Toggle between multiple themes when more than one is provided
- ❗️ Override theme at the component and story level through parameters
🏁 Getting Started
To get started, install the package as a dev dependency
yarn:
yarn add -D @storybook/addon-stylingnpm:
npm install -D @storybook/addon-stylingpnpm:
pnpm add -D @storybook/addon-stylingThen, include the addon in your .storybook/main.js file
module.exports = {
stories: [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)",
],
addons: [
"@storybook/addon-essentials",
+ "@storybook/addon-styling"
],
};👇 Tool specific configuration
For tool-specific setup, check out the recipes below
@emotion/styled@mui/materialbootstrapcssModulespostcsssassstyled-componentstailwindvuetify@3.x
Don't see your favorite tool listed? Don't worry! That doesn't mean this addon isn't for you. Check out the "Writing a custom decorator" section of the api reference.
❗️ Overriding theme
If you want to override your theme for a particular component or story, you can use the theming.themeOverride parameter.
import React from "react";
import { Button } from "./Button";
export default {
title: "Example/Button",
component: Button,
parameters: {
theming: {
themeOverride: "light", // component level override
},
},
};
const Template = (args) => <Button {...args} />;
export const Primary = Template.bind({});
Primary.args = {
primary: true,
label: "Button",
};
export const PrimaryDark = Template.bind({});
PrimaryDark.args = {
primary: true,
label: "Button",
};
PrimaryDark.parameters = {
theming: {
themeOverride: "dark", // Story level override
},
};🤝 Contributing
If you'd like to contribute to this addon, THANK YOU, I'd love your help 🙏
📝 Development scripts
yarn startruns babel in watch mode and starts Storybookyarn buildbuild and package your addon code
🌲 Branch structure
- next - the
nextversion on npm, and the development branch where most work occurs - main - the
latestversion on npm and the stable version that most users use
🚀 Release process
- All PRs should target the
nextbranch, which depends on thenextversion of Storybook. - When merged, a new version of this package will be released on the
nextNPM tag. - If the change contains a bugfix that needs to be patched back to the stable version, please note that in PR description.
- PRs labeled
pickwill get cherry-picked back to themainbranch and will generate a release on thelatestnpm tag.