storybook/docs/snippets/vue/checkbox-story.mdx-2.mdx.mdx

49 lines
905 B
Plaintext

```md
<!-- Checkbox.stories.mdx -->
import { Canvas, Meta, Story } from '@storybook/addon-docs';
import Checkbox from './Checkbox.vue';
<Meta title="MDX/Checkbox" component={Checkbox} />
export const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Checkbox },
template: '<Checkbox v-bind="$props" />',
});
# Checkbox
With `MDX`, we can define a story for `Checkbox` right in the middle of our
Markdown documentation.
<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>
```