You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `CheckboxGroup` and `RadioGroup` components are replacing the `ChoiceFieldset` component. The deprecation of `ChoiceFieldset` also allows us to deprecate `ChoiceInputField`.
9
+
The `CheckboxGroup` and `RadioGroup` components are replacing the `ChoiceFieldset` component.
10
10
11
11
`CheckboxGroup` and `RadioGroup` have the ability to render contextual content with your fieldset: labels, validation statuses, captions. They also handle the ARIA attributes that make the form controls accessible to assistive technology.
12
12
@@ -18,131 +18,96 @@ The `CheckboxGroup` and `RadioGroup` components are replacing the `ChoiceFieldse
18
18
<tdvalign="top">
19
19
20
20
```jsx
21
-
import {ChoiceFieldset} from"@primer/react"
22
-
23
-
<>
24
-
// Multi-select
25
-
<ChoiceFieldset>
26
-
<ChoiceFieldset.Legend>
27
-
Preferred Primer component interface
28
-
</ChoiceFieldset.Legend>
29
-
30
-
<ChoiceFieldset.List selectionVariant="multiple">
31
-
<ChoiceFieldset.Item value="figma">
32
-
Figma library
33
-
</ChoiceFieldset.Item>
34
-
<ChoiceFieldset.Item value="css">
35
-
Primer CSS
36
-
</ChoiceFieldset.Item>
37
-
<ChoiceFieldset.Item value="react">
38
-
Primer React components
39
-
</ChoiceFieldset.Item>
40
-
<ChoiceFieldset.Item value="viewcomponents">
41
-
Primer ViewComponents
42
-
</ChoiceFieldset.Item>
43
-
</ChoiceFieldset.List>
44
-
</ChoiceFieldset>
45
-
46
-
// Single select
47
-
<ChoiceFieldset>
48
-
<ChoiceFieldset.Legend>
49
-
Preferred Primer component interface
50
-
</ChoiceFieldset.Legend>
51
-
52
-
<ChoiceFieldset.List>
53
-
<ChoiceFieldset.Item value="figma">
54
-
Figma library
55
-
</ChoiceFieldset.Item>
56
-
<ChoiceFieldset.Item value="css">
57
-
Primer CSS
58
-
</ChoiceFieldset.Item>
59
-
<ChoiceFieldset.Item value="react">
60
-
Primer React components
61
-
</ChoiceFieldset.Item>
62
-
<ChoiceFieldset.Item value="viewcomponents">
63
-
Primer ViewComponents
64
-
</ChoiceFieldset.Item>
65
-
</ChoiceFieldset.List>
66
-
</ChoiceFieldset>
67
-
</>
68
-
21
+
import {ChoiceFieldset} from'@primer/react'
22
+
23
+
functionExample() {
24
+
return (
25
+
<>
26
+
{/* Multi-select */}
27
+
<ChoiceFieldset>
28
+
<ChoiceFieldset.Legend>Preferred Primer component interface</ChoiceFieldset.Legend>
<tr><th>Migration steps to CheckboxGroup and RadioGroup</th></tr>
131
-
<tr>
132
-
<td>
133
-
134
-
<strong>Upgrade to the new</strong> `CheckboxGroup` and `RadioGroup` components by referring to the examples in our documentation: [CheckboxGroup](https://primer.style/react/CheckboxGroup), [RadioGroup](https://primer.style/react/RadioGroup).
135
-
136
-
or
137
-
138
-
<strong>Continue using the deprecated</strong> `ChoiceFieldset` component :
107
+
To continue to use the deprecated API for now, change the import path to `@primer/react/deprecated`:
139
108
140
109
```js
141
-
import {ChoiceFieldset} from'@primer/react/deprecated'// change your import statements
0 commit comments