storybook/docs/snippets/react/button-story-component-args-primary.ts-4-9.mdx
2023-05-25 21:04:33 +01:00

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>;
```