Skip to content

Commit ec8aabe

Browse files
committed
feat(radio): add example with helptext and errortext
1 parent 069d183 commit ec8aabe

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

packages/components/src/field/field.css

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@layer sl-components {
2-
32
[data-sl-field] {
43
display: grid;
54
grid-template-areas: var(--sl-element-template-areas);
@@ -30,8 +29,8 @@
3029
&[data-variant='control'] {
3130
--sl-element-template-areas: 'input label' '- message';
3231
--sl-element-label-color: var(--sl-fg);
33-
--sl-element-vertical-gap: var(--sl-space-0);
3432
--sl-element-vertical-gap: calc(var(--sl-space-05) / 2);
33+
--sl-element-horizontal-gap: var(--sl-space-2);
3534
}
3635
}
3736
}

packages/components/src/radio/stories/radio.stories.tsx

+13
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,23 @@ export function Help() {
104104
<Radio value="opt4">Another pen</Radio>
105105
</RadioGroup>
106106

107+
<RadioGroup
108+
label="Optional group"
109+
errorText="Something is wrong"
110+
helpText="Pen pinapple apple pen"
111+
>
112+
<Radio value="opt1">Pen</Radio>
113+
<Radio value="opt2">Pineapple</Radio>
114+
<Radio value="opt3">Apple</Radio>
115+
<Radio value="opt4">Another pen</Radio>
116+
</RadioGroup>
117+
118+
107119
<RadioGroup
108120
label="Optional group (optional)"
109121
errorText="Something is wrong"
110122
helpText="Pen pinapple apple pen"
123+
error
111124
>
112125
<Radio value="opt1">Pen</Radio>
113126
<Radio value="opt2">Pineapple</Radio>

0 commit comments

Comments
 (0)