mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
18 lines
440 B
Plaintext
18 lines
440 B
Plaintext
```ts
|
|
// Button.stories.ts|tsx
|
|
|
|
// Replace your-framework with the name of your framework
|
|
import type { Meta } from '@storybook/your-framework';
|
|
import { fn } from '@storybook/test';
|
|
|
|
import { Button } from './Button';
|
|
|
|
const meta = {
|
|
component: Button,
|
|
// 👇 Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked
|
|
args: { onClick: fn() },
|
|
} satisfies Meta<typeof Button>;
|
|
|
|
export default meta;
|
|
```
|