Skip to content

Commit c50952d

Browse files
authored
Merge branch 'main' into mp/segmented-control-default-uncontrolled
2 parents 997cab0 + 8f5883d commit c50952d

File tree

2 files changed

+59
-3
lines changed

2 files changed

+59
-3
lines changed

docs/content/Checkbox.mdx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The `Checkbox` component can be used in controlled and uncontrolled modes.
4545
technologies.
4646
</Note>
4747

48-
## Indeterminate
48+
### Indeterminate
4949

5050
An `indeterminate` checkbox state should be used if the input value is neither true nor false. This can be useful in situations where you are required to display an incomplete state, or one that is dependent on other input selections to determine a value.
5151

@@ -74,6 +74,34 @@ An `indeterminate` checkbox state should be used if the input value is neither t
7474
</form>
7575
```
7676

77+
### Grouping Checkbox components
78+
79+
If you're not building something custom, you should use the [CheckboxGroup](/CheckboxGroup) component to render a group of checkbox inputs.
80+
81+
```jsx live
82+
<form>
83+
<CheckboxGroup>
84+
<CheckboxGroup.Label>Choices</CheckboxGroup.Label>
85+
<FormControl>
86+
<Checkbox value="1" />
87+
<FormControl.Label>Checkbox 1</FormControl.Label>
88+
</FormControl>
89+
<FormControl>
90+
<Checkbox value="2" />
91+
<FormControl.Label>Checkbox 2</FormControl.Label>
92+
</FormControl>
93+
<FormControl>
94+
<Checkbox value="3" />
95+
<FormControl.Label>Checkbox 3</FormControl.Label>
96+
</FormControl>
97+
<FormControl>
98+
<Checkbox value="4" />
99+
<FormControl.Label>Checkbox 4</FormControl.Label>
100+
</FormControl>
101+
</CheckboxGroup>
102+
</form>
103+
```
104+
77105
## Props
78106

79107
<PropsTable>

docs/content/Radio.mdx

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,39 @@ Please use a [Checkbox](/Checkbox) if the user needs to select more than one opt
3131

3232
</Note>
3333

34-
## Grouping Radio components
34+
### Grouping Radio components
3535

3636
Use the `name` prop to group together related `Radio` components in a list.
3737

38-
If you're not building something custom, you should use the [ChoiceFieldset](/ChoiceFieldset) component to render a group of radio inputs.
38+
If you're not building something custom, you should use the [RadioGroup](/RadioGroup) component to render a group of radio inputs.
39+
40+
#### Using `RadioGroup`
41+
42+
```jsx live
43+
<form>
44+
<RadioGroup name="radioGroup-example">
45+
<RadioGroup.Label>Choices</RadioGroup.Label>
46+
<FormControl>
47+
<Radio value="1" />
48+
<FormControl.Label>Radio 1</FormControl.Label>
49+
</FormControl>
50+
<FormControl>
51+
<Radio value="2" />
52+
<FormControl.Label>Radio 2</FormControl.Label>
53+
</FormControl>
54+
<FormControl>
55+
<Radio value="3" />
56+
<FormControl.Label>Radio 3</FormControl.Label>
57+
</FormControl>
58+
<FormControl>
59+
<Radio value="4" />
60+
<FormControl.Label>Radio 4</FormControl.Label>
61+
</FormControl>
62+
</RadioGroup>
63+
</form>
64+
```
65+
66+
#### Using `name` to group Radio components
3967

4068
```jsx live
4169
<form>

0 commit comments

Comments
 (0)