@gilbert
To add a global decorator in Storybook, you can create a file called .storybook/preview.js
in your project's root directory. In this file, you can import your global decorator and apply it to all of your stories.
Here is an example of how you can add a global decorator to Storybook:
1 2 3 4 |
import { addDecorator } from '@storybook/react'; import GlobalDecorator from './GlobalDecorator'; addDecorator(GlobalDecorator); |
By adding a global decorator in Storybook, you can easily apply common styles or configurations to all of your stories, making it easier to maintain a consistent look and feel across your components.