storybook/docs/snippets/web-components/component-story-conditional-controls-mutual-exclusion.ts.mdx
2023-05-25 21:04:33 +01:00

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