storybook/docs/snippets/vue/mdx-canvas-multiple-stories.mdx-2.mdx.mdx
2022-07-07 18:50:21 +01:00

51 lines
1.1 KiB
Plaintext

```md
<!-- Badge.stories.mdx -->
import { Canvas, Meta, Story } from '@storybook/addon-docs';
import Badge from './Badge.vue';
<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/vue/api/csf
to learn how to use render functions.
-->
<Canvas>
<Story
name="warning"
args={{
status: 'warning',
label: 'Warning',
}}
render={(args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Badge },
template: '<Badge v-bind="$props" />',
})} />
<Story
name="neutral"
args={{
status: 'neutral',
label: 'Neutral',
}}
render={(args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Badge },
template: '<Badge v-bind="$props" />',
})} />
<Story
name="error"
args={{
status: 'error',
label: 'Error',
}}
render={(args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Badge },
template: '<Badge v-bind="$props" />',
})} />
</Canvas>
```