mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 22:21:47 +08:00
21 lines
405 B
Plaintext
21 lines
405 B
Plaintext
```ts
|
|
// Button.stories.ts|tsx
|
|
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
|
|
import { action } from '@storybook/addon-actions';
|
|
|
|
import { Button } from './Button';
|
|
|
|
const meta: Meta<typeof Button> = {
|
|
component: Button,
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof Button>;
|
|
|
|
export const Basic: Story = {
|
|
render: () => <Button label="Hello" onClick={action('clicked')} />,
|
|
};
|
|
```
|