mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
23 lines
621 B
Plaintext
23 lines
621 B
Plaintext
```ts
|
|
// Button.stories.ts|tsx
|
|
|
|
// Replace your-framework with the name of your framework
|
|
import type { Meta } from '@storybook/your-framework';
|
|
|
|
import { Button } from './Button';
|
|
|
|
const meta = {
|
|
component: Button,
|
|
argTypes: {
|
|
label: { control: 'text' }, // Always shows the control
|
|
advanced: { control: 'boolean' },
|
|
// Only enabled if advanced is true
|
|
margin: { control: 'number', if: { arg: 'advanced' } },
|
|
padding: { control: 'number', if: { arg: 'advanced' } },
|
|
cornerRadius: { control: 'number', if: { arg: 'advanced' } },
|
|
},
|
|
} satisfies Meta<typeof Button>;
|
|
|
|
export default meta;
|
|
```
|