storybook/docs/snippets/react/mdx-canvas-multiple-stories.mdx.mdx
2022-07-07 19:47:29 +01:00

40 lines
839 B
Plaintext

```md
<!-- Badge.stories.mdx -->
import { Canvas, Meta, Story } from '@storybook/addon-docs';
import { Badge } from './Badge';
<Meta title="MDX/Badge" component={Badge} />
<!--
👇 Render functions are a framework specific feature to allow you control on how the component renders.
See https://storybook.js.org/docs/7.0/react/api/csf
to learn how to use render functions.
-->
<Canvas>
<Story
name="warning"
args={{
status: 'warning',
label: 'Warning',
}}
render={(args) => <Badge {...args } />} />
<Story
name="neutral"
args={{
status: 'neutral',
label: 'Neutral',
}}
render={(args) => <Badge {...args } />} />
<Story
name="error"
args={{
status: 'error',
label: 'Error',
}}
render={(args) => <Badge {...args } />} />
</Canvas>
```