mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 21:41:46 +08:00
60 lines
1.2 KiB
Plaintext
60 lines
1.2 KiB
Plaintext
```md
|
|
<!--- Checkbox.stories.mdx -->
|
|
|
|
import { Meta, Story, Canvas } from '@storybook/addon-docs';
|
|
|
|
import Checkbox from './Checkbox.vue';
|
|
|
|
<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) => ({
|
|
components: { Checkbox },
|
|
setup() {
|
|
return { args };
|
|
},
|
|
template: '<Checkbox v-bind="args" />',
|
|
})} />
|
|
|
|
<Story
|
|
name="Checked"
|
|
args={{
|
|
label: 'Unchecked',
|
|
checked: true
|
|
}}
|
|
render={(args) => ({
|
|
components: { Checkbox },
|
|
setup() {
|
|
return { args };
|
|
},
|
|
template: '<Checkbox v-bind="args" />',
|
|
})} />
|
|
|
|
<Story
|
|
name="Secondary"
|
|
args={{
|
|
label: 'Secondary',
|
|
checked: true,
|
|
appearance: 'secondary'
|
|
}}
|
|
render={(args) => ({
|
|
components: { Checkbox },
|
|
setup() {
|
|
return { args };
|
|
},
|
|
template: '<Checkbox v-bind="args" />',
|
|
})} />
|
|
</Canvas>
|
|
``` |