66
77` SfRadio ` provides additional styles for different states of ` <input type="radio"> ` . It can be used for choosing between a list of values when only one option can be selected at a time.
88
9+ <!--
910::tip
1011If you need to make this field required, it is crucial to communicate this intention clearly to your end users. You can find more information about [required form fields in our guide here](../blocks/FormFields.html).
1112::
13+ -->
1214
1315## Examples
1416
1517### Basic Usage
1618
1719<Showcase showcase-name =" Radio/RadioWithoutLabel " >
1820
19- :: vue-only
20- <<<../../../preview/nuxt/pages/showcases/Radio/RadioWithoutLabel.vue
21- ::
22- :: react-only
23- <<<../../../preview/next/pages/showcases/Radio/RadioWithoutLabel.tsx
24- ::
25- :: qwik-only
2621<<<../../../website/src/routes/showcases/Radio/RadioWithoutLabel/index.tsx
27- ::
2822
2923</Showcase >
3024
@@ -34,49 +28,26 @@ It's a best practice to use label with your `SfRadio` component so users can und
3428
3529<Showcase showcase-name =" Radio/RadioLeading " >
3630
37- :: vue-only
38- <<<../../../preview/nuxt/pages/showcases/Radio/RadioLeading.vue
39- ::
40- :: react-only
41- <<<../../../preview/next/pages/showcases/Radio/RadioLeading.tsx
42- ::
43- :: qwik-only
4431<<<../../../website/src/routes/showcases/Radio/RadioLeading/index.tsx
45- ::
4632
4733</Showcase >
4834
4935### Radio with trailing control
5036
5137<Showcase showcase-name =" Radio/RadioTrailing " >
5238
53- :: vue-only
54- <<<../../../preview/nuxt/pages/showcases/Radio/RadioTrailing.vue
55- ::
56- :: react-only
57- <<<../../../preview/next/pages/showcases/Radio/RadioTrailing.tsx
58- ::
59- :: qwik-only
6039<<<../../../website/src/routes/showcases/Radio/RadioTrailing/index.tsx
61- ::
6240
6341</Showcase >
6442
43+ <!--
6544### With legend
6645
6746Radio Group can have a `legend` tag, which represents a caption for the content of its parent `fieldset` tag.
6847
6948<Showcase showcase-name="RadioGroup/RadioGroupWithLegend">
7049
71- :: vue-only
72- <<<../../../preview/nuxt/pages/showcases/RadioGroup/RadioGroupWithLegend.vue
73- ::
74- :: react-only
75- <<<../../../preview/next/pages/showcases/RadioGroup/RadioGroupWithLegend.tsx
76- ::
77- :: qwik-only
7850<<<../../../website/src/routes/showcases/RadioGroup/RadioGroupWithLegend/index.tsx
79- ::
8051
8152</Showcase>
8253
@@ -86,103 +57,31 @@ Radio components can be aligned inside RadioGroup in a `column` or in a `row`.
8657
8758<Showcase showcase-name="RadioGroup/RadioGroupAlignment" >
8859
89- :: vue-only
90- <<<../../../preview/nuxt/pages/showcases/RadioGroup/RadioGroupAlignment.vue
91- ::
92- :: react-only
93- <<<../../../preview/next/pages/showcases/RadioGroup/RadioGroupAlignment.tsx
94- ::
95- :: qwik-only
9660<<<../../../website/src/routes/showcases/RadioGroup/RadioGroupAlignment/index.tsx
97- ::
98-
99- </Showcase >
100-
101- :: react-only
102-
103- ### Uncontrolled Group
104-
105- <Showcase showcase-name =" RadioGroup/RadioGroupUncontrolled " >
106-
107- <<<../../../preview/next/pages/showcases/RadioGroup/RadioGroupUncontrolled.tsx
108-
109- </Showcase >
11061
111- ::
112-
113- :: qwik-only
114-
115- ### Uncontrolled Group
116-
117- <Showcase showcase-name =" RadioGroup/RadioGroupUncontrolled " >
118-
119- <<<../../../website/src/routes/showcases/RadioGroup/RadioGroupUncontrolled/index.tsx
120-
121- </Showcase >
122-
123- ::
62+ </Showcase> -->
12463
64+ <!--
12565## Accessibility notes
12666
12767You can provide a bigger hit area for your radio buttons by making your `label` element another trigger for the radio button. This can be done by wrapping the `input` element in a `label` element.
12868
12969When multiple radio elements are grouped together, one of their parent elements should have [`role="radiogroup"`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/radiogroup_role). This will help indicate which radio inputs affect the same value.
13070
13171If you have an element that is not an `<input type="radio">`, you should set the [role="radio"](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/radio_role) so that it is recognized as a radio button.
72+ -->
13273
13374## Playground
13475
135- <Generate />
76+ <Generate class = " playground " style = " height : 700 px ; " />
13677
13778#tab-2
13879
13980## Props
14081
141- :: vue-only
142- | Prop name | Type | Default value | Possible values |
143- | ---------- | ----------------------------- | ------------- | --------------------- |
144- | ` name ` \* | ` string ` | | |
145- | ` invalid ` | ` boolean ` | ` false ` | |
146- | ` value ` | ` string ` | | |
147- | ` modelValue ` | ` string ` | | |
148- | ` disabled ` | ` boolean ` | ` false ` | |
149- ::
150- :: react-only
151- | Prop name | Type | Default value | Possible values |
152- | ---------- | ----------------------------- | ------------- | --------------------- |
153- | ` name ` \* | ` string ` | | |
154- | ` invalid ` | ` boolean ` | ` false ` | |
155- | ` checked ` | ` boolean ` | | |
156- | ` onChange ` | ` Function ` | | |
157- | ` className ` | ` string ` | | |
158- ::
159- :: qwik-only
160- | Prop name | Type | Default value | Possible values |
161- | ---------- | ----------------------------- | ------------- | --------------------- |
162- | ` name ` \* | ` string ` | | |
163- | ` invalid ` | ` boolean ` | ` false ` | |
164- | ` checked ` | ` boolean ` | | |
165- | ` onChange ` | ` Function ` | | |
166- | ` className ` | ` string ` | | |
167- ::
168-
169- :: vue-only
170-
171- ## Events
172-
173- | Event name | Trigger |
174- | ------------------- | ------------------------- |
175- | ` update:modelValue ` | triggers radio event emit |
176-
177- ::
178-
179- #tab-3
180- :: vue-only
181- <<<../../../../packages/sfui/frameworks/vue/components/SfRadio/SfRadio.vue
182- ::
183-
184- :: react-only
185- <<< ../../../../packages/sfui/frameworks/react/components/SfRadio/SfRadio.tsx
186- ::
187-
188- ::
82+ | Prop name | Type | Default value | Possible values |
83+ | ----------- | ------------------------------------------------------------------ | ------------- | --------------- |
84+ | ` class? ` | ` string ` | | |
85+ | ` ref? ` | ` Signal<Element> ` | | |
86+ | ` invalid? ` | ` boolean ` | ` false ` | |
87+ | ` onChange$ ` | ` PropFunction<(event: QwikChangeEvent<HTMLInputElement>) => void> ` | | |
0 commit comments