Storybook addon for styled components with theme provider
npm install storybook-addon-styled-components-themes
yarn add storybook-addon-styled-components-themes --D
`
Configuration
$3
`
module.exports = {
stories: ['../src/*/.stories.(tsx|mdx)'],
addons: ['storybook-addon-styled-components-themes/register']
};
`
$3
`
addParameters({
styledComponentsThemes: {
/**
* Themes
*/
themes: [ThemeA, ThemeB],
/**
* Theme to start on - index - optional
*/
initialTheme: 1, // optional
/**
* Key for show name of theme - optional
*/
label: 'name', // optional
},
});
`
$3
`
addDecorator(story => (
{story()}
));
``