mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 08:01:20 +08:00
39 lines
838 B
Plaintext
39 lines
838 B
Plaintext
```md
|
|
<!--- Checkbox.stories.mdx -->
|
|
|
|
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
import { Checkbox } from './Checkbox';
|
|
|
|
<Meta title="MDX/Checkbox" component={Checkbox} />
|
|
|
|
# Checkbox
|
|
|
|
With `MDX` we can define a story for `Checkbox` right in the middle of our
|
|
Markdown documentation.
|
|
|
|
<!--- This is your Story template function, shown here in React -->
|
|
|
|
export const Template = (args) => <Checkbox {...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>
|
|
|
|
``` |