# storybook-addon-styled-components-themes

> Storybook addon for styled components with theme provider

Latest version **0.0.2** (published 2021-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install storybook-addon-styled-components-themes
pnpm add storybook-addon-styled-components-themes
yarn add storybook-addon-styled-components-themes
bun add storybook-addon-styled-components-themes
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2021-07-21 |
| First published | 2020-04-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Elsa Santos |
| Maintainers | elsa-santos |
| Keywords | react, react-component, storybook, addon, theme, themes, addons, styled-components, typescript, javascript |

## Links

- npm: https://www.npmjs.com/package/storybook-addon-styled-components-themes
- Repository: https://github.com/elsa-santos/storybook-addon-styled-components-themes
- Homepage: https://github.com/elsa-santos/storybook-addon-styled-components-themes#readme
- Issues: https://github.com/elsa-santos/storybook-addon-styled-components-themes/issues
- npm.io page: https://npm.io/package/storybook-addon-styled-components-themes

## Dependencies (5)

- [react](https://npm.io/package/react.md) ^16.13.0
- [typescript](https://npm.io/package/typescript.md) ~3.7.2
- [@storybook/api](https://npm.io/package/@storybook/api.md) ^5.3.18
- [@storybook/theming](https://npm.io/package/@storybook/theming.md) ^5.3.18
- [@storybook/components](https://npm.io/package/@storybook/components.md) ^5.3.18

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2021-07-21
- 0.0.1 — 2020-04-04

## README

# Storybook/Addon: styled-components with themes

Storybook addon for styled components with theme provider

![](https://media.giphy.com/media/hT0xI1YDfzQrvyttsD/giphy.gif)


## Getting Started

### Installing

```
yarn add storybook-addon-styled-components-themes --D
```

## Configuration

### Register the addon in .storybook/main.js

```
module.exports = {
  stories: ['../src/**/*.stories.(tsx|mdx)'],
  addons: ['storybook-addon-styled-components-themes/register']
};

```

### Add parameters to stories in .storybook/preview.js

```
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
  },
});
```

### Add decorator to stories in .storybook/preview.js

```
addDecorator(story => (
    <WithThemeProvider>
        {story()}
    </WithThemeProvider>
));
```

## License

This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/elsa-santos/storybook-addon-styled-components-themes/blob/master/LICENSE) file for details

---
_Source: https://npm.io/package/storybook-addon-styled-components-themes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
