Skip to content

Commit 0f614a5

Browse files
Refine Checkbox story code examples (#1320)
1 parent 608d7bf commit 0f614a5

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

src/components/checkbox/checkbox.stories.mdx

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,51 @@ import './demo/styles.scss';
1414
`c-checkbox` may be applied to any `<input type="checkbox">` element. They are larger than native checkboxes and more visually consistent with our [input](/docs/components-input--text-elements) and [button](/docs/components-button--elements) components.
1515

1616
<Canvas>
17-
<Story name="Enabled" height="120px" args={{ disabled: false }}>
17+
<Story
18+
name="Enabled"
19+
height="120px"
20+
args={{ disabled: false }}
21+
parameters={{
22+
docs: {
23+
source: {
24+
code: `<label>
25+
{% include '@cloudfour/components/checkbox/checkbox.twig' only %}
26+
Unchecked
27+
</label>
28+
<label>
29+
{% include '@cloudfour/components/checkbox/checkbox.twig' with { checked: true } only %}
30+
Checked
31+
</label>`,
32+
},
33+
},
34+
}}
35+
>
1836
{(args) => withLabelDemo(args)}
1937
</Story>
2038
</Canvas>
2139

2240
Checkboxes appear more subtle and less actionable when the `disabled` attribute is set.
2341

2442
<Canvas>
25-
<Story name="Disabled" height="120px" args={{ disabled: true }}>
43+
<Story
44+
name="Disabled"
45+
height="120px"
46+
args={{ disabled: true }}
47+
parameters={{
48+
docs: {
49+
source: {
50+
code: `<label>
51+
{% include '@cloudfour/components/checkbox/checkbox.twig' with { disabled: true } only %}
52+
Unchecked
53+
</label>
54+
<label>
55+
{% include '@cloudfour/components/checkbox/checkbox.twig' with { disabled: true, checked: true } only %}
56+
Checked
57+
</label>`,
58+
},
59+
},
60+
}}
61+
>
2662
{(args) => withLabelDemo(args)}
2763
</Story>
2864
</Canvas>

0 commit comments

Comments
 (0)