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
* allows FormControl.Label to render as a span or legend and updates the SegmentedControl example to render the label as a span
* changes SegmentedControl.IconButton to use aria-current instead of aria-pressed
* nicer small screen experience for the SegmentedControl story that shows it associated with a label and caption
* allows referencing a label for the ActionMenu
* fixes a bug where 'defaultSelected' prop would not work
* updates docs
* Update generated/components.json
* adds changeset
* fixes bug that broke selected segment test
* fixes styling issue where segment separation border was appearing on top of the outline
* fixes linting issue
---------
Co-authored-by: mperrotti <mperrotti@users.noreply.github.com>
Addresses feedback from the accessibility team about our SegmentedControl component. These changes include an update to ActionMenu that allows u to specify the ID of the DOM node that labels the menu.
A `SegmentedControl` should not be used in a form as a replacement for something like a [RadioGroup](/RadioGroup) or [Select](/Select). See the [Accessibility section](https://primer.style/design/components/segmented-control#accessibility) of the SegmentedControl interface guidelines for more details.
Copy file name to clipboardExpand all lines: generated/components.json
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2692,6 +2692,12 @@
2692
2692
"defaultValue": "false",
2693
2693
"description": "Whether the label should be visually hidden"
2694
2694
},
2695
+
{
2696
+
"name": "as",
2697
+
"type": "'label' | 'legend' | 'span'",
2698
+
"defaultValue": "'label'",
2699
+
"description": "The label element can be changed to a 'legend' when it's being used to label a fieldset, or a 'span' when it's being used to label an element that is not a form input. For example: when using a FormControl to render a labeled SegementedControl, the label should be a 'span'"
Copy file name to clipboardExpand all lines: src/FormControl/FormControl.docs.json
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,12 @@
49
49
"defaultValue": "false",
50
50
"description": "Whether the label should be visually hidden"
51
51
},
52
+
{
53
+
"name": "as",
54
+
"type": "'label' | 'legend' | 'span'",
55
+
"defaultValue": "'label'",
56
+
"description": "The label element can be changed to a 'legend' when it's being used to label a fieldset, or a 'span' when it's being used to label an element that is not a form input. For example: when using a FormControl to render a labeled SegementedControl, the label should be a 'span'"
0 commit comments