Back to integrations
Add your integration
Categories
  • ⭐️ Popular
  • 🧩 Essentials
  • 🛠 Code
  • ⚡️ Data & state
  • ✅ Test
  • 💅 Style
  • 🎨 Design
  • ⚙️ Appearance
  • 🗄 Organize
How to install addons Create an addon
storybook-addon-chakra-theme
storybook addon with chakra theme
npm install storybook-addon-chakra-theme
Last updated about 2 years ago
72
Downloads per week
Readme View on GitHub

Installation

yarn add storybook-addon-chakra-theme --dev

Add to .storybook/addons.js

import 'storybook-addon-chakra-theme/dist/register';

addDecorator to .storybook/config.js

import { addDecorator } from '@storybook/react';
import { withThemesProvider } from 'storybook-addon-chakra-theme';

const themes = [theme1, theme2];
addDecorator(withThemesProvider(themes));

or

addDecorator to stories

import {withThemesProvider} from 'storybook-addon-chakra-theme';

const themes = [theme1, theme2];

storiesOf("demo", module)
  .addDecorator(withThemesProvider(themes))
  .add("demo div", () => <div>DEMO</div>);

Reminder

Make sure every theme has a name property. For example:

const myTheme = {
  name: "Light",
  primaryColor: "blue"
}

This is used for displaying in the Storybook UI.

Contributing

yarn

yarn build

yarn example

Thanks and License Reference

https://github.com/echoulen/storybook-addon-styled-component-theme https://github.com/JumboInteractiveLimited/storybook-addon-emotion-theme

Join the community
6,595 developers and counting
WhyWhy StorybookComponent-driven UI
DocsGuidesTutorialsChangelogTelemetryStatus
CommunityAddonsGet involvedBlog
ShowcaseExploreProjectsComponent glossary
Open source software
Storybook

Maintained by
Chromatic
Special thanks to Netlify and CircleCI