{"id":18799748,"url":"https://github.com/echoulen/storybook-addon-styled-component-theme","last_synced_at":"2025-04-04T17:05:30.109Z","repository":{"id":34513195,"uuid":"137453716","full_name":"echoulen/storybook-addon-styled-component-theme","owner":"echoulen","description":"storybook addon","archived":false,"fork":false,"pushed_at":"2022-04-29T17:58:44.000Z","size":760,"stargazers_count":191,"open_issues_count":10,"forks_count":25,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T16:05:20.642Z","etag":null,"topics":["addon","react","storybook","styled-components","styled-components-theme","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/echoulen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-15T07:11:45.000Z","updated_at":"2024-10-08T06:53:53.000Z","dependencies_parsed_at":"2022-08-08T03:15:18.644Z","dependency_job_id":null,"html_url":"https://github.com/echoulen/storybook-addon-styled-component-theme","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echoulen%2Fstorybook-addon-styled-component-theme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echoulen%2Fstorybook-addon-styled-component-theme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echoulen%2Fstorybook-addon-styled-component-theme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echoulen%2Fstorybook-addon-styled-component-theme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/echoulen","download_url":"https://codeload.github.com/echoulen/storybook-addon-styled-component-theme/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217174,"owners_count":20903008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addon","react","storybook","styled-components","styled-components-theme","typescript"],"created_at":"2024-11-07T22:16:18.997Z","updated_at":"2025-04-04T17:05:30.080Z","avatar_url":"https://github.com/echoulen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/storybook-addon-styled-component-theme.svg)](https://badge.fury.io/js/storybook-addon-styled-component-theme)\n[![build status](https://travis-ci.org/echoulen/storybook-addon-styled-component-theme.svg?branch=master)](https://travis-ci.org/echoulen/storybook-addon-styled-component-theme)\n[![codecov](https://codecov.io/gh/echoulen/storybook-addon-styled-component-theme/branch/master/graph/badge.svg)](https://codecov.io/gh/echoulen/storybook-addon-styled-component-theme)\n\n![](https://media.giphy.com/media/FfFvOA9C0h9bhfCuNX/giphy.gif)\n\nThis addon allows storybook to showcase components with multiple different styled-component themes.\nSupports storybook v4, v5, v6 and newer\n\n## Installation\n\n```bash\nyarn add storybook-addon-styled-component-theme --dev\n```\n\n# Configuration\n\n## storybook v6\n\n#### Add a decorator to stories in .storybook/preview.js\n\n```javascript\n\nimport { addDecorator } from \"@storybook/react\";\nimport { withThemesProvider } from \"storybook-addon-styled-component-theme\";\nimport { ThemeProvider } from \"styled-components\";\n\nconst themes = [theme1, theme2];\naddDecorator(withThemesProvider(themes, ThemeProvider));\n```\n\n#### Add to .storybook/main.js\n\n```\nmodule.exports = {\n  ...\n  addons: [\n    ...\n    \"storybook-addon-styled-component-theme/dist/preset\"\n  ]\n};\n```\n\n## storybook v5 and v4\n\n#### Add to .storybook/addons.js\n\n```javascript\n// v1.3, storybook v5.2\nimport \"storybook-addon-styled-component-theme/dist/register\";\n\n// v1.2, storybook v4, v5.0\nimport \"storybook-addon-styled-component-theme/dist/src/register\";\n```\n\n#### addDecorator to .storybook/preview.js\n\n```javascript\nimport { addDecorator } from \"@storybook/react\";\nimport { withThemesProvider } from \"storybook-addon-styled-component-theme\";\n\nconst themes = [theme1, theme2];\naddDecorator(withThemesProvider(themes));\n```\n\n#### Remind\n\nMake sure every theme object has a `name` property\n\n## Contributing\n\n##### Build local library\n\n```shell\nyarn\n\nyarn build\n```\n\n##### Start the local example\n\n```shell\ncd example\n\nyarn\n\nyarn storybook\n```\n\n#### Run all the spec\n\n```shell\nyarn test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechoulen%2Fstorybook-addon-styled-component-theme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fechoulen%2Fstorybook-addon-styled-component-theme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechoulen%2Fstorybook-addon-styled-component-theme/lists"}