Back to integrations
Add your integration
Categories
  • ⭐️ Popular
  • 🧩 Essentials
  • 🛠 Code
  • ⚡️ Data & state
  • ✅ Test
  • 💅 Style
  • 🎨 Design
  • ⚙️ Appearance
  • 🗄 Organize
How to install addons Create an addon
Customize antd theme
a Storybook addon help you visually customize an ant design theme
npm install storybook-addon-customize-antd-theme
Last updated over 2 years ago
1.9k
Downloads per week
Readme View on GitHub

npm version GitHub license code style: prettier


storybook-addon-customize-antd-theme

A Storybook addon that help you visually customize an ant design theme in the addon panel for better UI-development workflow.

English | 简体中文

Requirements

  • Storybook@>=6.0.0

Getting started

1. Install

npm install -D storybook-addon-customize-antd-theme
# yarn add -D storybook-addon-customize-antd-theme

2. Register the addon in main.js

module.exports = {
  stories: ['storybook-addon-customize-antd-theme/dist/esm/stories/index.js'],
  addons: ['storybook-addon-customize-antd-theme'],
};

3. Setting default story states

You can initial setup ant design theme, by setting the customizeAntdTheme property on parameters:

// .storybook/preview.js

export const parameters = {
  customizeAntdTheme: {
    modifyVars: {
      'primary-color': '#ff1771',
      'border-radius-base': '20px',
    },
  },
};

modifyVars can also be less string, you can import a less file by raw-loader, for example:

// .storybook/preview.js
import themeLess from '!!raw-loader!../src/theme/theme.less';
export const parameters = {
  customizeAntdTheme: {
    modifyVars: themeLess,
  },
};
Join the community
6,591 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