storybook/docs/snippets/react/checkbox-story.mdx.mdx
2021-10-12 21:52:15 +01:00

44 lines
894 B
Plaintext

```md
<!--- Checkbox.stories.mdx -->
import { Meta, Story, Canvas } from '@storybook/addon-docs';
import { Checkbox } from './Checkbox';
<Meta title="MDX/Checkbox" component={Checkbox} />
<!-- Render functions are a framework specific feature to allow you control on how the component renders -->
# 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',
}}
render={(args) => <Checkbox {...args} />} />
<Story
name="Checked"
args={{
label: 'Unchecked',
checked: true,
}}
render={(args) => <Checkbox {...args} />} />
<Story
name="Secondary"
args={{
label: 'Secondary',
checked: true,
appearance: 'secondary',
}}
render={(args) => <Checkbox {...args} />} />
</Canvas>
```