mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-11 00:06:25 +08:00
22 lines
463 B
Plaintext
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;
|
|
```
|