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

21 lines
407 B
Plaintext

```js
// Button.stories.js|jsx
import { Button } from './Button';
export default {
component: 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 },
},
},
};
```