mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
18 lines
457 B
Plaintext
18 lines
457 B
Plaintext
```js
|
|
// Button.stories.js|jsx
|
|
|
|
import { Button } from './Button';
|
|
|
|
export default {
|
|
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' } },
|
|
},
|
|
};
|
|
```
|