mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 07:13:34 +08:00
23 lines
456 B
Plaintext
23 lines
456 B
Plaintext
```ts
|
|
// Button.stories.ts
|
|
|
|
import type { Meta } from '@storybook/web-components';
|
|
|
|
const meta: Meta = {
|
|
component: 'demo-button',
|
|
argTypes: {
|
|
// Button can be passed a label or an image, not both
|
|
label: {
|
|
control: 'text',
|
|
if: { arg: 'image', truthy: false },
|
|
},
|
|
image: {
|
|
control: { type: 'select', options: ['foo.jpg', 'bar.jpg'] },
|
|
if: { arg: 'label', truthy: false },
|
|
},
|
|
},
|
|
};
|
|
|
|
export default meta;
|
|
```
|