storybook/docs/snippets/react/your-component-with-decorator.ts.mdx
2023-05-25 21:04:33 +01:00

22 lines
463 B
Plaintext

```ts
// YourComponent.stories.ts|tsx
import type { Meta } from '@storybook/react';
import { YourComponent } from './YourComponent';
const meta: Meta<typeof YourComponent> = {
component: YourComponent,
decorators: [
(Story) => (
<div style={{ margin: '3em' }}>
{/* 👇 Decorators in Storybook also accept a function. Replace <Story/> with Story() to enable it */}
<Story />
</div>
),
],
};
export default meta;
```