storybook/docs/snippets/vue/checkbox-story.mdx-3.mdx.mdx
2021-08-05 18:51:23 +01:00

43 lines
855 B
Plaintext

```md
<!--- Checkbox.stories.mdx -->
import { Meta, Story, Canvas } from '@storybook/addon-docs';
import Checkbox from './Checkbox.vue';
<Meta title="MDX/Checkbox" component={Checkbox} />
# Checkbox
With `MDX`, we can define a story for `Checkbox` right in the middle of our
Markdown documentation.
export const Template = (args) => ({
components: { Checkbox },
setup() {
return { args };
},
template: '<Checkbox v-bind="args" />',
});
<Canvas>
<Story name="Unchecked" args={{
label: 'Unchecked'
}}>
{Template.bind({})}
</Story>
<Story name="Checked" args={{
label: 'Unchecked',
checked: true
}}>
{Template.bind({})}
</Story>
<Story name="Secondary" args={{
label: 'Secondary',
checked: true,
appearance: 'secondary'
}}>
{Template.bind({})}
</Story>
</Canvas>
```