mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
19 lines
430 B
Plaintext
19 lines
430 B
Plaintext
```ts
|
|
// Button.stories.ts
|
|
// Replace your-framework with the name of your framework
|
|
import type { Meta } from '@storybook/your-framework';
|
|
import { action } from '@storybook/addon-actions';
|
|
|
|
import Button from './Button';
|
|
|
|
const meta: Meta<typeof Button> {
|
|
component: Button,
|
|
args: {
|
|
// 👇 Create an action that appears when the onClick event is fired
|
|
onClick: action('on-click'),
|
|
},
|
|
};
|
|
|
|
export default meta;
|
|
```
|