storybook/docs/snippets/common/mdx-canvas-multiple-stories.mdx.mdx
2021-05-07 12:11:09 +08:00

21 lines
549 B
Plaintext

```md
<!-- MyComponent.stories.mdx --->
import { Canvas } from '@storybook/addon-docs';
<!--- This is your Story template function, shown here in React -->
export const Template = (args) => <Badge {...args } />;
<Canvas>
<Story name="warning" args={{status: 'warning', label: 'Warning'}}>
{Template.bind({})}
</Story>
<Story name="neutral" args={{status: 'neutral', label: 'Neutral' }}>
{Template.bind({})}
</Story>
<Story name="error" args={{status: 'error', label: 'Error' }}>
{Template.bind({})}
</Story>
</Canvas>
```