mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 07:01:53 +08:00
20 lines
506 B
Plaintext
20 lines
506 B
Plaintext
```ts
|
|
// Button.stories.ts
|
|
|
|
import type { Meta } from '@storybook/web-components';
|
|
|
|
const meta: Meta = {
|
|
component: 'demo-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' } },
|
|
},
|
|
};
|
|
|
|
export default meta;
|
|
```
|