WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.
Discussion options

You must be logged in to vote

i found how to do it :

pnpm add --save-dev @react-theming/storybook-addon

// .storybook/main.js

module.exports = {
  stories: ['../src/**/*.stories.js'],
  addons: ['@react-theming/storybook-addon'],
};

then in preview.cjs

export const parameters = {
     actions: { argTypesRegex: "^on[A-Z].*" },
     controls: {
          matchers: {
               color: /(background|color)$/i,
               date: /Date$/,
          },
     },
};

import { ThemeProvider } from "styled-components";
import { withThemes } from "@react-theming/storybook-addon";

const theme = {
     color: "red",
};
// addDecorator is deprecated :
// https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecate…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tarik-gadoumi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant