Storybook addon for styled components with theme provider
yarn add storybook-addon-styled-components-themes --D
module.exports = {
stories: ['../src/**/*.stories.(tsx|mdx)'],
addons: ['storybook-addon-styled-components-themes/register']
};
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
},
});
addDecorator(story => (
<WithThemeProvider>
{story()}
</WithThemeProvider>
));
This project is licensed under the MIT License - see the LICENSE.md file for details