storybook/docs/snippets/svelte/checkbox-story.mdx.mdx
2021-08-08 18:33:11 +01:00

46 lines
818 B
Plaintext

```md
<!--- Checkbox.stories.mdx -->
import { Meta, Story, Canvas } from '@storybook/addon-docs';
import Checkbox from './Checkbox.svelte';
<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) => ({
Component: Button,
props: 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>
```