mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
23 lines
428 B
Plaintext
23 lines
428 B
Plaintext
```ts
|
|
// Button.stories.ts|tsx
|
|
|
|
import type { Meta } from '@storybook/react';
|
|
|
|
import { Button } from './Button';
|
|
|
|
const meta = {
|
|
component: Button,
|
|
//👇 Creates specific argTypes
|
|
argTypes: {
|
|
backgroundColor: { control: 'color' },
|
|
},
|
|
args: {
|
|
//👇 Now all Button stories will be primary.
|
|
primary: true,
|
|
},
|
|
} satisfies Meta<typeof Button>;
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof meta>;
|
|
```
|