:::warning
-**Draft — partial coverage.** This report covers the 13 components assessed so far, not the whole library. It has not been reviewed by an external auditor, and no assistive-technology testing has been performed yet. See [Scope and limitations](#scope-and-limitations) before relying on it for a procurement decision.
+**Draft — partial coverage.** This report covers only the components in the [component table](#conformance-by-component), not the whole library. It has not been reviewed by an external auditor, and no assistive-technology testing has been performed yet. See [Scope and limitations](#scope-and-limitations) before relying on it for a procurement decision.
:::
## About this report
@@ -41,6 +41,7 @@ Each row counts only the criteria that **apply** to that component; criteria tha
| [AccordionSummary](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/AccordionSummary/accessibility.md) | 13 | 11 | 24 | 23 | 1 | 21/24 | 11 |
| [Avatar](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Avatar/accessibility.md) | 5 | 6 | 11 | 9 | 2 | 6/11 | 2 |
| [Button](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Button/accessibility.md) | 15 | 12 | 27 | 24 | 3 | 20/27 | 11 |
+| [ButtonGroup](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ButtonGroup/accessibility.md) | 4 | 6 | 10 | 9 | 1 | 7/10 | 4 |
| [Checkbox](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Checkbox/accessibility.md) | 14 | 11 | 25 | 24 | 1 | 22/25 | 11 |
| [CircularProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CircularProgress/accessibility.md) | 6 | 5 | 11 | 8 | 3 | 6/11 | 1 |
| [LinearProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/LinearProgress/accessibility.md) | 6 | 5 | 11 | 8 | 3 | 6/11 | 1 |
@@ -80,17 +81,17 @@ An application built with Material UI is not automatically accessible. Material
## Known gaps
-Five issues account for every ⚠️ rating. Two of them can be fixed through the theme today.
+Each ⚠️ rating comes from one of the issues below. Some of them can be fixed through the theme today.
-| Gap | Criteria | Affected | Workaround |
-| :------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------- |
-| **By default, the keyboard focus indicator is the ripple or a background tint, with untested contrast** | [1.4.11 Non-text Contrast](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html) | [AccordionSummary](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/AccordionSummary/accessibility.md) [Button](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Button/accessibility.md) [Checkbox](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Checkbox/accessibility.md) [Radio](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Radio/accessibility.md) [Switch](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Switch/accessibility.md) [ToggleButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ToggleButton/accessibility.md) | Enable `focusVisible` in your theme — see below |
-| **Some default palette colors fall short of contrast minimums** | [1.4.3 Contrast (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html) [1.4.11 Non-text Contrast](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html) | [Avatar](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Avatar/accessibility.md) [Button](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Button/accessibility.md) [CircularProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CircularProgress/accessibility.md) (`warning` with `enableTrackSlot`) [LinearProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/LinearProgress/accessibility.md) [Switch](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Switch/accessibility.md) [TextField](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/TextField/accessibility.md) [ToggleButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ToggleButton/accessibility.md) | Override the affected palette entries |
-| **The selected state of colored Toggle Buttons is conveyed almost entirely by hue** | [1.4.1 Use of Color](https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html) | [ToggleButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ToggleButton/accessibility.md) (`primary`, `error`, `info`, `success`) | Add a non-color cue to the selected state, such as an icon |
-| **Dynamic state changes are not announced** | [4.1.3 Status Messages](https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html) | [Button](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Button/accessibility.md) (`loading`) [CircularProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CircularProgress/accessibility.md) [LinearProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/LinearProgress/accessibility.md) [TextField](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/TextField/accessibility.md) (error) | Render your own `aria-live` region alongside |
-| **Indefinite animation cannot be paused** | [2.2.2 Pause, Stop, Hide](https://www.w3.org/WAI/WCAG22/Understanding/pause-stop-hide.html) | [CircularProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CircularProgress/accessibility.md) (`indeterminate`) [LinearProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/LinearProgress/accessibility.md) (`indeterminate`, `query`, `buffer`) | Show it only while an operation is in flight |
+| Gap | Criteria | Affected | Workaround |
+| :------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------- |
+| **By default, the keyboard focus indicator is the ripple or a background tint, and its contrast can fall below 3:1** | [1.4.11 Non-text Contrast](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html) | [AccordionSummary](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/AccordionSummary/accessibility.md) [Button](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Button/accessibility.md) [ButtonGroup](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ButtonGroup/accessibility.md) [Checkbox](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Checkbox/accessibility.md) [Radio](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Radio/accessibility.md) [Switch](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Switch/accessibility.md) [ToggleButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ToggleButton/accessibility.md) | Enable `focusVisible` in your theme — see below |
+| **Some default palette colors fall short of contrast minimums** | [1.4.3 Contrast (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html) [1.4.11 Non-text Contrast](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html) | [Avatar](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Avatar/accessibility.md) [Button](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Button/accessibility.md) [CircularProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CircularProgress/accessibility.md) (`warning` with `enableTrackSlot`) [LinearProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/LinearProgress/accessibility.md) [Switch](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Switch/accessibility.md) [TextField](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/TextField/accessibility.md) [ToggleButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ToggleButton/accessibility.md) | Override the affected palette entries |
+| **The selected state of colored Toggle Buttons is conveyed almost entirely by hue** | [1.4.1 Use of Color](https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html) | [ToggleButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ToggleButton/accessibility.md) (`primary`, `error`, `info`, `success`) | Add a non-color cue to the selected state, such as an icon |
+| **Dynamic state changes are not announced** | [4.1.3 Status Messages](https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html) | [Button](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Button/accessibility.md) (`loading`) [CircularProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CircularProgress/accessibility.md) [LinearProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/LinearProgress/accessibility.md) [TextField](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/TextField/accessibility.md) (error) | Render your own `aria-live` region alongside |
+| **Indefinite animation cannot be paused** | [2.2.2 Pause, Stop, Hide](https://www.w3.org/WAI/WCAG22/Understanding/pause-stop-hide.html) | [CircularProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CircularProgress/accessibility.md) (`indeterminate`) [LinearProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/LinearProgress/accessibility.md) (`indeterminate`, `query`, `buffer`) | Show it only while an operation is in flight |
@@ -106,7 +107,7 @@ const theme = createTheme({ focusVisible: true });
Read this section before citing the report.
:::
-- **Component coverage is partial.** 13 components are assessed. Widely used components including Select, Autocomplete, Dialog, Menu, Table, Tabs, Slider, Tooltip, Snackbar, and Drawer are **not yet assessed**, and this report says nothing about them.
+- **Component coverage is partial.** Only the components in the [component table](#conformance-by-component) are assessed. Widely used components including Select, Autocomplete, Dialog, Menu, Table, Tabs, Slider, Tooltip, Snackbar, and Drawer are **not yet assessed**, and this report says nothing about them.
- **No assistive-technology testing.** No screen-reader passes have been performed. Criteria that depend on how a specific assistive technology behaves are assessed from the exposed accessibility tree, not from observed behavior.
- **Level AAA is out of scope**, as it is for a standard VPAT.
- **Components are rated in isolation**, as rendered with default props and the default theme. Customization, composition, and your surrounding page can change the result.
diff --git a/docs/data/material/getting-started/accessibility/knownGaps.json b/docs/data/material/getting-started/accessibility/knownGaps.json
index 6062cc623e1f74..fda4ea55374a8e 100644
--- a/docs/data/material/getting-started/accessibility/knownGaps.json
+++ b/docs/data/material/getting-started/accessibility/knownGaps.json
@@ -1,8 +1,16 @@
[
{
- "gap": "By default, the keyboard focus indicator is the ripple or a background tint, with untested contrast",
+ "gap": "By default, the keyboard focus indicator is the ripple or a background tint, and its contrast can fall below 3:1",
"criteria": ["1.4.11"],
- "affected": ["AccordionSummary", "Button", "Checkbox", "Radio", "Switch", "ToggleButton"],
+ "affected": [
+ "AccordionSummary",
+ "Button",
+ "ButtonGroup",
+ "Checkbox",
+ "Radio",
+ "Switch",
+ "ToggleButton"
+ ],
"workaround": "Enable `focusVisible` in your theme — see below"
},
{
diff --git a/docs/data/material/getting-started/accessibility/scorecard.json b/docs/data/material/getting-started/accessibility/scorecard.json
index 5602791ebcc2b5..67f6edc644a60c 100644
--- a/docs/data/material/getting-started/accessibility/scorecard.json
+++ b/docs/data/material/getting-started/accessibility/scorecard.json
@@ -1,6 +1,6 @@
{
"standard": "WCAG 2.2 Level A and AA",
- "componentCount": 13,
+ "componentCount": 14,
"totals": {
"rated": 32,
"supports": 27,
@@ -99,6 +99,7 @@
"AccordionSummary",
"Avatar",
"Button",
+ "ButtonGroup",
"Checkbox",
"CircularProgress",
"LinearProgress",
@@ -1144,6 +1145,139 @@
"automated": 11
}
},
+ {
+ "component": "ButtonGroup",
+ "counts": {
+ "supports": 9,
+ "partiallySupports": 1,
+ "doesNotSupport": 0,
+ "notApplicable": 28,
+ "inherited": 17,
+ "flagged": 3,
+ "rated": 10
+ },
+ "gaps": [
+ {
+ "number": "1.4.11",
+ "name": "Non-text Contrast",
+ "conformance": "Partially Supports"
+ },
+ {
+ "number": "1.4.3",
+ "name": "Contrast (Minimum)",
+ "conformance": "Partially Supports",
+ "from": "Button"
+ },
+ {
+ "number": "4.1.3",
+ "name": "Status Messages",
+ "conformance": "Partially Supports",
+ "from": "Button"
+ }
+ ],
+ "criteria": [
+ {
+ "number": "1.3.1",
+ "name": "Info and Relationships",
+ "level": "A",
+ "conformance": "Supports",
+ "responsibility": "Shared",
+ "group": "Hybrid",
+ "flagged": false
+ },
+ {
+ "number": "1.3.2",
+ "name": "Meaningful Sequence",
+ "level": "A",
+ "conformance": "Supports",
+ "responsibility": "Shared",
+ "group": "Manual",
+ "flagged": true
+ },
+ {
+ "number": "1.4.4",
+ "name": "Resize Text",
+ "level": "AA",
+ "conformance": "Supports",
+ "responsibility": "Shared",
+ "group": "Automated",
+ "flagged": false
+ },
+ {
+ "number": "1.4.10",
+ "name": "Reflow",
+ "level": "AA",
+ "conformance": "Supports",
+ "responsibility": "Shared",
+ "group": "Automated",
+ "flagged": false
+ },
+ {
+ "number": "1.4.11",
+ "name": "Non-text Contrast",
+ "level": "AA",
+ "conformance": "Partially Supports",
+ "responsibility": "Component",
+ "group": "Manual",
+ "flagged": true
+ },
+ {
+ "number": "1.4.12",
+ "name": "Text Spacing",
+ "level": "AA",
+ "conformance": "Supports",
+ "responsibility": "Shared",
+ "group": "Automated",
+ "flagged": false
+ },
+ {
+ "number": "2.4.3",
+ "name": "Focus Order",
+ "level": "A",
+ "conformance": "Supports",
+ "responsibility": "Shared",
+ "group": "Automated",
+ "flagged": false
+ },
+ {
+ "number": "2.4.6",
+ "name": "Headings and Labels",
+ "level": "AA",
+ "conformance": "Supports",
+ "responsibility": "Shared",
+ "group": "Manual",
+ "flagged": true
+ },
+ {
+ "number": "2.4.7",
+ "name": "Focus Visible",
+ "level": "AA",
+ "conformance": "Supports",
+ "responsibility": "Shared",
+ "group": "Hybrid",
+ "flagged": false
+ },
+ {
+ "number": "4.1.2",
+ "name": "Name, Role, Value",
+ "level": "A",
+ "conformance": "Supports",
+ "responsibility": "Shared",
+ "group": "Hybrid",
+ "flagged": false
+ }
+ ],
+ "summary": {
+ "rated": 10,
+ "levelA": 4,
+ "levelAA": 6,
+ "supports": 9,
+ "partiallySupports": 1,
+ "doesNotSupport": 0,
+ "verified": 7,
+ "automated": 4
+ }
+ },
{
"component": "Checkbox",
"counts": {
diff --git a/packages/mui-material/src/ButtonGroup/ButtonGroup.test.js b/packages/mui-material/src/ButtonGroup/ButtonGroup.test.js
index 6f426cac527469..2be31c541b871e 100644
--- a/packages/mui-material/src/ButtonGroup/ButtonGroup.test.js
+++ b/packages/mui-material/src/ButtonGroup/ButtonGroup.test.js
@@ -1,5 +1,12 @@
import { describe, it, expect } from 'vitest';
-import { createRenderer, screen, simulateKeyboardDevice, isJsdom } from '@mui/internal-test-utils';
+import * as React from 'react';
+import {
+ createRenderer,
+ screen,
+ simulateKeyboardDevice,
+ isJsdom,
+ within,
+} from '@mui/internal-test-utils';
import ButtonGroup, { buttonGroupClasses as classes } from '@mui/material/ButtonGroup';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import Button, { buttonClasses } from '@mui/material/Button';
@@ -365,4 +372,106 @@ describe('', () => {
expect(button).not.to.have.class(classes.lastButton);
});
});
+
+ describe('WCAG 2.2 conformance', () => {
+ describe('1.3.1 Info and Relationships', () => {
+ it('exposes the buttons as one group', () => {
+ render(
+
+
+
+ ,
+ );
+
+ const group = screen.getByRole('group', { name: 'Text alignment' });
+ expect(within(group).getAllByRole('button')).to.have.length(2);
+ });
+ });
+
+ describe('2.4.3 Focus Order', () => {
+ ['horizontal', 'vertical'].forEach((orientation) => {
+ it(`moves through a ${orientation} group in DOM order`, async () => {
+ const { user } = render(
+
+
+
+
+ ,
+ );
+
+ for (const name of ['One', 'Two', 'Three']) {
+ // eslint-disable-next-line no-await-in-loop
+ await user.tab();
+ expect(screen.getByRole('button', { name })).toHaveFocus();
+ }
+ });
+ });
+
+ it('removes the buttons of a disabled group from the tab order', async () => {
+ const { user } = render(
+
+
+
+
+
+
+
+ ,
+ );
+
+ await user.tab();
+ await user.tab();
+ expect(screen.getByRole('button', { name: 'After' })).toHaveFocus();
+ });
+ });
+
+ // JSDOM doesn't support :focus-visible
+ it.skipIf(isJsdom())(
+ '2.4.7 Focus Visible: with the theme ring, the focused button paints above its neighbors',
+ async () => {
+ const { user } = render(
+
+
+
+
+
+ ,
+ );
+
+ await user.tab();
+ const focused = screen.getByRole('button', { name: 'One' });
+ expect(focused).to.have.class(buttonClasses.focusVisible);
+ // The neighbors overlap by 1px, so a lower z-index would cover the ring edge.
+ expect(window.getComputedStyle(focused).zIndex).to.equal('1');
+ expect(
+ window.getComputedStyle(screen.getByRole('button', { name: 'Two' })).zIndex,
+ ).to.equal('auto');
+ },
+ );
+
+ describe('4.1.2 Name, Role, Value', () => {
+ it('has the group role and the name from aria-label', () => {
+ render(
+
+
+ ,
+ );
+
+ expect(screen.getByRole('group')).toHaveAccessibleName('Export format');
+ });
+
+ it('passes the disabled state to each button', () => {
+ render(
+
+
+
+ ,
+ );
+
+ screen.getAllByRole('button').forEach((button) => {
+ expect(button).to.have.property('disabled', true);
+ });
+ });
+ });
+ });
});
diff --git a/packages/mui-material/src/ButtonGroup/accessibility.json b/packages/mui-material/src/ButtonGroup/accessibility.json
new file mode 100644
index 00000000000000..4e9ab0ce5ec7b0
--- /dev/null
+++ b/packages/mui-material/src/ButtonGroup/accessibility.json
@@ -0,0 +1,16 @@
+{
+ "axe": "docs/data/material/components/button-group/button-group.a11y.json",
+ "inherits": "Button",
+ "criteria": {
+ "1.3.1": {},
+ "1.3.2": { "responsibility": "Shared", "flagged": true },
+ "1.4.4": {},
+ "1.4.10": {},
+ "1.4.11": { "group": "Manual" },
+ "1.4.12": {},
+ "2.4.3": {},
+ "2.4.6": { "group": "Manual", "flagged": true },
+ "2.4.7": {},
+ "4.1.2": {}
+ }
+}
diff --git a/packages/mui-material/src/ButtonGroup/accessibility.md b/packages/mui-material/src/ButtonGroup/accessibility.md
new file mode 100644
index 00000000000000..25465ff6acede9
--- /dev/null
+++ b/packages/mui-material/src/ButtonGroup/accessibility.md
@@ -0,0 +1,278 @@
+
+
+# ButtonGroup accessibility conformance
+
+Rated against WCAG 2.2 Level A and AA. See the [reports legend](../accessibility.md).
+
+
+
+A ButtonGroup puts several Buttons in one set. This report rates only what the group adds: the group role and name, the layout, the dividers, and the focus order. Each button inherits the [Button report](../Button/accessibility.md).
+
+
+
+| Result | Count |
+| :----------------------- | :---- |
+| ✅ Supports | 9 |
+| ⚠️ Partially Supports | 1 |
+| ❌ Does Not Support | 0 |
+| ➖ Not Applicable | 28 |
+| ↗ Inherited (see Button) | 17 |
+| 🚩 Flagged | 3/10 |
+
+## Known gaps
+
+- ⚠️ **1.4.11 Non-text Contrast.** The buttons keep the Button focus ripple as their default focus indicator. Its contrast can fall below `3:1`. `disableRipple` or `disableFocusRipple` on the group removes it from each button.
+- Inherits ⚠️ **1.4.3 Contrast (Minimum)** from [Button](../Button/accessibility.md).
+- Inherits ⚠️ **4.1.3 Status Messages** from [Button](../Button/accessibility.md).
+
+## Success criteria
+
+### 🔍 Manual
+
+#### 1.3.2 Meaningful Sequence · A
+
+`🚩` · `✅ Supports` · `◐ Shared`
+
+
+
+- The group shows its buttons in DOM order, in a row or in a column. It does not reverse the order.
+- The order of the children is an author decision.
+
+**Manual testing steps**
+
+1. Press Tab through a horizontal group.
+2. Press Tab through a vertical group.
+3. Compare the focus order with the visual order in each group.
+4. Read each group with the screen-reader virtual cursor.
+
+
+
+**Pass:** focus and the reading order move in the reading direction in a horizontal group, and from top to bottom in a vertical group.
+
+#### 1.4.11 Non-text Contrast · AA
+
+`🚩` · `⚠️ Partially Supports` · `● Component`
+
+
+
+- The dividers between the buttons have these contrasts against the adjacent colors, in light mode:
+ - `outlined` and `text`: the `main` color at `50%` on a white page, `1.77:1` (`warning`) to `2.39:1` (`secondary`). With `color="inherit"`, `1.74:1`.
+ - `contained`: the `dark` color between two `main` fills, `1.13:1` (`error`) to `1.92:1` (`info`). With `color="inherit"`, `grey[400]` on `grey[300]` is `1.42:1`.
+- In an `outlined` group, the divider is the border of the next button. So the `outlined` border has the same contrast.
+- WCAG does not require a boundary when text or an icon identifies the control (Understanding 1.4.11). Each button has its own label, so the dividers do not need `3:1`.
+- The focus indicator is the Button focus ripple. `disableRipple` and `disableFocusRipple` on the group pass to each button, so one group prop can remove the indicator from all buttons. `disableElevation` removes the focus shadow of a `contained` button.
+
+**Manual testing steps**
+
+1. With a contrast checker, measure the dividers of each variant in use against the colors next to them.
+2. Measure the `outlined` border against the page.
+3. Press Tab to a button in the group.
+4. Measure the focus indicator against the colors next to it.
+
+
+
+**Pass:** each button can be identified by its label, and the focus indicator is at least `3:1`.
+
+#### 2.4.6 Headings and Labels · AA
+
+`🚩` · `✅ Supports` · `◐ Shared`
+
+
+
+- The group name, from `aria-label`, describes the purpose of the set of buttons. Each button keeps its own label.
+- Whether the group name is useful is an authoring concern.
+
+**Manual testing steps**
+
+1. List the `aria-label` of each ButtonGroup.
+2. Read each name without the buttons.
+
+
+
+**Pass:** each group name tells the purpose of the set, for example "Text alignment", not "Basic button group".
+
+### 🔁 Hybrid
+
+#### 1.3.1 Info and Relationships · A
+
+`✅ Supports` · `◐ Shared`
+
+Tested by: unit `ButtonGroup.test.js`
+
+
+
+- The root has `role="group"`, so assistive technology reports the buttons as one set. A unit test confirms the role. An author can replace it with the `role` prop.
+- The author names the group with `aria-label` or `aria-labelledby`. The component does not warn when the name is missing. A group without a name still conveys the grouping.
+
+**Manual testing steps**
+
+1. Start a screen reader (NVDA with Chrome, or VoiceOver with Safari).
+2. Press Tab into a ButtonGroup that has an `aria-label`.
+3. Listen to the announcement.
+4. Do the test again with a group that has no `aria-label`.
+
+
+
+**Pass:** the screen reader announces the group role and name, and the name and role of the button. A group with no name is announced as a group.
+
+#### 2.4.7 Focus Visible · AA
+
+`✅ Supports` · `◐ Shared`
+
+Tested by: unit `ButtonGroup.test.js` · Playwright
+
+
+
+- Keyboard focus shows the Button focus ripple, inside the button, so the neighbors cannot cover it. A Playwright test confirms that keyboard focus changes how the button looks.
+- In a `contained` group without the theme ring, the focused button also gets a shadow. The next button can cover the edge of this shadow.
+- With `focusVisible: true` on the theme, the focused button gets the outline ring and `z-index: 1`. The neighbors touch the focused button. In an `outlined` group, they overlap it by 1 px. The ring paints above them. A unit test in a real browser confirms the `z-index`. In a `contained` group, the ring replaces the shadow.
+- `disableRipple` or `disableFocusRipple` on the group removes the ripple from each button.
+
+**Manual testing steps**
+
+1. Press Tab through the buttons of a horizontal and a vertical group.
+2. Make sure that the focus indicator of each button is fully visible.
+3. Set `focusVisible: true` on the theme and do the test again.
+
+
+
+**Pass:** the focus indicator of each button is fully visible, and the adjacent buttons do not cover the ring.
+
+#### 4.1.2 Name, Role, Value · A
+
+`✅ Supports` · `◐ Shared`
+
+Tested by: unit `ButtonGroup.test.js` · axe-core `aria-allowed-attr` ✅, `aria-conditional-attr` ✅, `aria-deprecated-role` ✅, `aria-hidden-focus` ✅, `aria-prohibited-attr` ✅, `aria-required-attr` ✅, `aria-roles` ✅, `aria-valid-attr` ✅, `aria-valid-attr-value` ✅, `button-name` ✅, `duplicate-id-aria` ✅, `link-name` ✅, `nested-interactive` ✅
+
+
+
+- The group has `role="group"` and the name from `aria-label`. `disabled` on the group disables each button that does not set its own `disabled` prop. Unit tests confirm this. The axe-core ARIA rules pass on the demos.
+- In a split button, the author sets `aria-haspopup="menu"`, `aria-expanded`, and `aria-label` on the arrow button. The SplitButton demo and the `ButtonGroupA11ySemanticStates` fixture show this pattern.
+
+**Manual testing steps**
+
+1. Start a screen reader.
+2. Press Tab to the arrow button of the SplitButton demo.
+3. Listen to the announcement.
+4. Press Enter to open the menu.
+5. Press Shift+Tab to move focus back to the arrow button.
+6. Listen to the announcement again.
+
+
+
+**Pass:** the arrow button announces its name, that it opens a menu, and "collapsed" or "expanded".
+
+### ⚙️ Automated
+
+#### 1.4.4 Resize Text · AA
+
+`✅ Supports` · `◐ Shared`
+
+Tested by: Playwright
+
+
+
+- The buttons scale with the text size, and the group grows with them. A Playwright test confirms that the variant demo does not clip or overflow at a 200% text size.
+
+
+
+#### 1.4.10 Reflow · AA
+
+`✅ Supports` · `◐ Shared`
+
+Tested by: Playwright
+
+
+
+- A horizontal group is an `inline-flex` row that does not wrap. When the group is too wide, each button wraps its label first. When that is not enough, the page scrolls horizontally.
+- A Playwright test confirms that the three-button variant demo does not scroll at 320 px. A browser probe measured the `ButtonGroupA11yWideGroup` fixture, with five buttons: the page scrolls horizontally by about 126 px at 320 px.
+- The number of buttons is an author decision. To fix a wide group, set `orientation="vertical"` on small screens, for example with `useMediaQuery`.
+
+
+
+#### 1.4.12 Text Spacing · AA
+
+`✅ Supports` · `◐ Shared`
+
+Tested by: Playwright
+
+
+
+- The buttons wrap their labels, and the group grows with them. A Playwright test confirms this with the WCAG text-spacing values.
+
+
+
+#### 2.4.3 Focus Order · A
+
+`✅ Supports` · `◐ Shared`
+
+Tested by: unit `ButtonGroup.test.js`
+
+
+
+- Each button is a tab stop in DOM order, in both orientations. A disabled group removes its buttons from the tab order. Unit tests confirm this. For the manual check, see 1.3.2.
+
+
+
+## Inherited from Button
+
+- **1.1.1 Non-text Content (A).**
+- **1.3.3 Sensory Characteristics (A).**
+- **1.4.1 Use of Color (A).**
+- **1.4.3 Contrast (Minimum) (AA).**
+- **1.4.5 Images of Text (AA).**
+- **2.1.1 Keyboard (A).**
+- **2.1.2 No Keyboard Trap (A).**
+- **2.4.4 Link Purpose (In Context) (A).** A grouped Button with `href`. The `ButtonGroupA11ySemanticStates` fixture has one, and axe-core `link-name` passes on it.
+- **2.4.11 Focus Not Obscured (Minimum) (AA).**
+- **2.5.2 Pointer Cancellation (A).**
+- **2.5.3 Label in Name (A).**
+- **2.5.8 Target Size (Minimum) (AA).** The group lowers the minimum width of each button to 40 px, which is still larger than 24 px.
+- **3.2.1 On Focus (A).**
+- **3.2.2 On Input (A).**
+- **3.2.4 Consistent Identification (AA).**
+- **3.3.2 Labels or Instructions (A).** Applies only to a grouped file-upload Button.
+- **4.1.3 Status Messages (AA).** A grouped Button with `loading`, as in the `LoadingButtonGroup` demo.
+
+## Not applicable
+
+- **1.2.1 Audio-only and Video-only (Prerecorded) (A), 1.2.2 Captions (Prerecorded) (A), 1.2.3 Audio Description or Media Alternative (Prerecorded) (A), 1.2.4 Captions (Live) (AA), 1.2.5 Audio Description (Prerecorded) (AA).** No audio or video.
+- **1.3.4 Orientation (AA).** Sets no orientation lock; a layout concern.
+- **1.3.5 Identify Input Purpose (AA).** Collects no information about the user through `autocomplete`.
+- **1.4.2 Audio Control (A).** Emits no audio.
+- **1.4.13 Content on Hover or Focus (AA).** Shows no additional content on hover or focus; a `Tooltip` wrapper would own this.
+- **2.1.4 Character Key Shortcuts (A).** Binds no single-character keyboard shortcut.
+- **2.2.1 Timing Adjustable (A).** Sets no time limit.
+- **2.2.2 Pause, Stop, Hide (A).** No auto-starting moving, blinking, or auto-updating content.
+- **2.3.1 Three Flashes or Below Threshold (A).** Nothing flashes.
+- **2.4.1 Bypass Blocks (A), 2.4.2 Page Titled (A), 2.4.5 Multiple Ways (AA).** Page or site structure, not a single component.
+- **2.5.1 Pointer Gestures (A), 2.5.4 Motion Actuation (A).** Activates on a simple click; reads no device motion.
+- **2.5.7 Dragging Movements (AA).** No drag interactions.
+- **3.1.1 Language of Page (A), 3.1.2 Language of Parts (AA).** The component emits no `` and no text of its own. A foreign-language label is the author's phrase to mark.
+- **3.2.3 Consistent Navigation (AA).** Covers repeated navigation across a set of pages, not a single component.
+- **3.2.6 Consistent Help (A).** Covers consistent placement of help across pages.
+- **3.3.1 Error Identification (A), 3.3.3 Error Suggestion (AA), 3.3.4 Error Prevention (Legal, Financial, Data) (AA).** Collects and validates no input; these belong to the form or process.
+- **3.3.7 Redundant Entry (A).** Captures no previously entered data to repopulate.
+- **3.3.8 Accessible Authentication (Minimum) (AA).** No authentication step; the duty falls on the credential fields.
+
+## Level AAA
+
+
+
+- **2.4.13 Focus Appearance.** The buttons keep the Button focus ripple, which does not meet it. `🚩`
+- **2.5.5 Target Size (Enhanced), 44 px.** The buttons keep the Button sizes, which are less than 44 px high. `🚩`
+
+
+
+## Scope and test environment
+
+- **Standard.** WCAG 2.2, Level A and AA.
+- **Component version.** `@mui/material` 10.0.0-alpha.0.
+
+
+
+- **Scope.** The ButtonGroup wrapper, rendered through its documented API. The buttons inside it inherit the [Button report](../Button/accessibility.md).
+- **Automated.** axe-core in the Playwright test harness, on the ButtonGroup demos and fixtures in [`button-group.a11y.json`](../../../../docs/data/material/components/button-group/button-group.a11y.json). Interaction tests are in `ButtonGroup.test.js`.
+- **Assistive-technology review.** Not done yet. The flagged criteria come from a review of the source. A review with NVDA, JAWS, and VoiceOver must still confirm them.
+
+
diff --git a/packages/mui-material/src/accessibility.md b/packages/mui-material/src/accessibility.md
index ccd0a626c6386c..2987af024bbd85 100644
--- a/packages/mui-material/src/accessibility.md
+++ b/packages/mui-material/src/accessibility.md
@@ -187,6 +187,7 @@ Edit the JSON files, not this table.
| [AccordionSummary](./AccordionSummary/accessibility.md) | 23 | 1 | 0 | 31 | — | 3/24 |
| [Avatar](./Avatar/accessibility.md) | 9 | 2 | 0 | 44 | — | 5/11 |
| [Button](./Button/accessibility.md) | 24 | 3 | 0 | 28 | — | 7/27 |
+| [ButtonGroup](./ButtonGroup/accessibility.md) | 9 | 1 | 0 | 28 | 17 | 3/10 |
| [Checkbox](./Checkbox/accessibility.md) | 24 | 1 | 0 | 30 | — | 3/25 |
| [CircularProgress](./CircularProgress/accessibility.md) | 8 | 3 | 0 | 44 | — | 5/11 |
| [LinearProgress](./LinearProgress/accessibility.md) | 8 | 3 | 0 | 44 | — | 5/11 |
diff --git a/packages/mui-material/src/manual-testing.md b/packages/mui-material/src/manual-testing.md
index 4a34f0df831d0a..8edfa43b488342 100644
--- a/packages/mui-material/src/manual-testing.md
+++ b/packages/mui-material/src/manual-testing.md
@@ -79,6 +79,17 @@ Run the rows matching what you touched, for the component you touched.
- [ ] 🔁 **4.1.2 Name, Role, Value** — name, role, and state are correct for every variant, and state changes are announced.
- [ ] 🔍 **4.1.3 Status Messages** — the change is announced without the user moving focus to it. It is not, because the component adds no live region; wrap the status in `role="status"` to fix it.
+## ButtonGroup
+
+6 checks · full procedures in [`ButtonGroup/accessibility.md`](./ButtonGroup/accessibility.md)
+
+- [ ] 🔁 **1.3.1 Info and Relationships** — the screen reader announces the group role and name, and the name and role of the button. A group with no name is announced as a group.
+- [ ] 🔍 **1.3.2 Meaningful Sequence** — focus and the reading order move in the reading direction in a horizontal group, and from top to bottom in a vertical group.
+- [ ] 🔍 **1.4.11 Non-text Contrast** — each button can be identified by its label, and the focus indicator is at least `3:1`.
+- [ ] 🔍 **2.4.6 Headings and Labels** — each group name tells the purpose of the set, for example "Text alignment", not "Basic button group".
+- [ ] 🔁 **2.4.7 Focus Visible** — the focus indicator of each button is fully visible, and the adjacent buttons do not cover the ring.
+- [ ] 🔁 **4.1.2 Name, Role, Value** — the arrow button announces its name, that it opens a menu, and "collapsed" or "expanded".
+
## Checkbox
9 checks · full procedures in [`Checkbox/accessibility.md`](./Checkbox/accessibility.md)
diff --git a/scripts/a11yScorecard/rollup.mjs b/scripts/a11yScorecard/rollup.mjs
index e055f9eb641d44..41807ffd17c586 100644
--- a/scripts/a11yScorecard/rollup.mjs
+++ b/scripts/a11yScorecard/rollup.mjs
@@ -22,17 +22,22 @@ const ratingOf = (fields) => Object.fromEntries(RATING_KEYS.map((key) => [key, f
* criterion unless its own `notApplicable` lists it or it is not applicable by
* default. Keying a default not-applicable criterion in `criteria` rates it. A
* component with `inherits` rates only the criteria it keys, and inherits the
- * rest that its parent rates.
+ * rest that its parent rates, including default not-applicable ones. It cannot
+ * list those in `notApplicable`.
*/
function resolveReport(source, defaults, resolveParent) {
const { component, data, regions, axe, ownTests, extraTests } = source;
const overrides = data.criteria;
const ownNotApplicable = new Set(data.notApplicable ?? []);
+ const parent = data.inherits ? resolveParent(data.inherits) : null;
+ // A criterion the parent rates stays applicable, even when it is not applicable by default.
+ const parentRates = new Set((parent?.criteria ?? []).map(({ number }) => number));
const isNotApplicable = (number) =>
ownNotApplicable.has(number) ||
- (Boolean(defaults.data.criteria[number]?.notApplicable) && !(number in overrides));
+ (Boolean(defaults.data.criteria[number]?.notApplicable) &&
+ !(number in overrides) &&
+ !parentRates.has(number));
- const parent = data.inherits ? resolveParent(data.inherits) : null;
const rates = (number) => !isNotApplicable(number) && (parent ? number in overrides : true);
const unitRefs = new Map();
diff --git a/test/regressions/a11y/criteriaSuites.mjs b/test/regressions/a11y/criteriaSuites.mjs
index c8fcde0fe3808c..c27c9ffd5743b8 100644
--- a/test/regressions/a11y/criteriaSuites.mjs
+++ b/test/regressions/a11y/criteriaSuites.mjs
@@ -21,6 +21,7 @@ export const CSS_LAYOUT_SUITES = [
skipCriteria: ['1.4.4'],
},
{ component: 'Button', route: '/docs-components-buttons/BasicButtons' },
+ { component: 'ButtonGroup', route: '/docs-components-button-group/VariantButtonGroup' },
{ component: 'Checkbox', route: '/docs-components-checkboxes/Checkboxes' },
{
component: 'CircularProgress',
@@ -59,6 +60,11 @@ export const FOCUS_VISIBLE_TARGETS = [
route: '/docs-components-buttons/BasicButtons',
selector: '.MuiButton-root',
},
+ {
+ component: 'ButtonGroup',
+ route: '/docs-components-button-group/BasicButtonGroup',
+ selector: '.MuiButtonGroup-grouped',
+ },
{
component: 'Checkbox',
route: '/docs-components-checkboxes/Checkboxes',
diff --git a/test/regressions/a11y/fixtures/button-group/ButtonGroupA11ySemanticStates.js b/test/regressions/a11y/fixtures/button-group/ButtonGroupA11ySemanticStates.js
new file mode 100644
index 00000000000000..8e2187da99fbb9
--- /dev/null
+++ b/test/regressions/a11y/fixtures/button-group/ButtonGroupA11ySemanticStates.js
@@ -0,0 +1,43 @@
+import Stack from '@mui/material/Stack';
+import Button from '@mui/material/Button';
+import ButtonGroup from '@mui/material/ButtonGroup';
+import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
+import FormatAlignLeftIcon from '@mui/icons-material/FormatAlignLeft';
+import FormatAlignCenterIcon from '@mui/icons-material/FormatAlignCenter';
+
+export default function ButtonGroupA11ySemanticStates() {
+ return (
+
+
+ }>Left
+ }>Center
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/* The split button pattern, with `aria-expanded` set while the menu is closed. */}
+
+
+
+
+
+ );
+}
diff --git a/test/regressions/a11y/fixtures/button-group/ButtonGroupA11yWideGroup.js b/test/regressions/a11y/fixtures/button-group/ButtonGroupA11yWideGroup.js
new file mode 100644
index 00000000000000..b7145c61d06004
--- /dev/null
+++ b/test/regressions/a11y/fixtures/button-group/ButtonGroupA11yWideGroup.js
@@ -0,0 +1,17 @@
+import Button from '@mui/material/Button';
+import ButtonGroup from '@mui/material/ButtonGroup';
+
+// A horizontal group with more buttons than fit at 320 CSS px. The group does
+// not wrap its buttons, so the page scrolls horizontally. The screenshot at
+// 320 px records this author concern (1.4.10); see ButtonGroup/accessibility.md.
+export default function ButtonGroupA11yWideGroup() {
+ return (
+
+
+
+
+
+
+
+ );
+}
diff --git a/test/regressions/demoMeta.test.ts b/test/regressions/demoMeta.test.ts
index 3b66852404ebe8..281bc94b464f51 100644
--- a/test/regressions/demoMeta.test.ts
+++ b/test/regressions/demoMeta.test.ts
@@ -118,6 +118,30 @@ describe('getConfig', () => {
});
});
+ it('records the wide ButtonGroup fixture at 320 px', () => {
+ expect(
+ getConfig(A11Y_RULES, 'test/regressions/a11y/fixtures/button-group/ButtonGroupA11yWideGroup'),
+ ).to.deep.include({ enabled: true, assertions: 'all' });
+ expect(
+ getConfig(
+ SCREENSHOT_RULES,
+ 'test/regressions/a11y/fixtures/button-group/ButtonGroupA11yWideGroup',
+ ),
+ ).to.deep.include({ enabled: true, viewportWidth: 320 });
+ });
+
+ it('asserts every rule on the enrolled ButtonGroup demos and fixture', () => {
+ expect(
+ getConfig(A11Y_RULES, 'docs/data/material/components/button-group/SplitButton'),
+ ).to.deep.include({ enabled: true, assertions: 'all' });
+ expect(
+ getConfig(
+ A11Y_RULES,
+ 'test/regressions/a11y/fixtures/button-group/ButtonGroupA11ySemanticStates',
+ ),
+ ).to.deep.include({ enabled: true, assertions: 'all' });
+ });
+
it('returns undefined for a demo outside a brace-glob enrolment', () => {
// Button a11y enrolment covers @mui/material/Button, not IconButton.
expect(getConfig(A11Y_RULES, 'docs/data/material/components/buttons/DisabledButtons')).to.equal(
diff --git a/test/regressions/demoMeta.ts b/test/regressions/demoMeta.ts
index 6469ebe98df752..a0d70ee4e2aada 100644
--- a/test/regressions/demoMeta.ts
+++ b/test/regressions/demoMeta.ts
@@ -175,6 +175,11 @@ export const SCREENSHOT_RULES: ScreenshotRule[] = [
{ test: 'test/regressions/a11y/fixtures/**', enabled: false }, // A11y-only coverage fixtures
{ test: 'test/regressions/a11y/fixtures/buttons/ButtonA11yTextSpacing', enabled: true }, // Visual regression for text spacing (1.4.12); adds no unique axe coverage
{ test: 'test/regressions/a11y/fixtures/accordion/AccordionA11yTextSpacing', enabled: true }, // Visual regression for text spacing (1.4.12); adds no unique axe coverage
+ {
+ test: 'test/regressions/a11y/fixtures/button-group/ButtonGroupA11yWideGroup',
+ enabled: true,
+ viewportWidth: 320,
+ }, // Visual record of a wide horizontal group at 320 CSS px (1.4.10)
{
test: 'test/regressions/a11y/fixtures/toggle-button/ToggleButtonA11yTextSpacing',
enabled: true,
@@ -240,6 +245,18 @@ const BUTTON_A11Y_DEMOS = [
'CustomizedButtons',
];
+// ButtonGroup docs demos enrolled for axe assertions. SplitButton renders only the
+// closed menu button; the open menu needs interaction.
+const BUTTON_GROUP_A11Y_DEMOS = [
+ 'BasicButtonGroup',
+ 'VariantButtonGroup',
+ 'GroupSizesColors',
+ 'GroupOrientation',
+ 'DisableElevation',
+ 'LoadingButtonGroup',
+ 'SplitButton',
+];
+
// Radio docs demos enrolled for axe assertions. FormControlLabelPlacement is left out: its axe
// output duplicates RowRadioButtonsGroup (a row RadioGroup with a FormLabel), adding no new rules.
const RADIO_A11Y_DEMOS = [
@@ -371,6 +388,18 @@ export const A11Y_RULES: A11yRule[] = [
assertions: 'all',
skipAssertions: ['color-contrast'],
},
+ {
+ test: `docs/data/material/components/button-group/{${BUTTON_GROUP_A11Y_DEMOS.join(',')}}`,
+ enabled: true,
+ assertions: 'all',
+ },
+ // A11y-only fixtures under `test/regressions/a11y/fixtures/button-group/`; the
+ // suite name maps their results into the same `button-group.a11y.json`.
+ {
+ test: 'test/regressions/a11y/fixtures/button-group/{ButtonGroupA11ySemanticStates,ButtonGroupA11yWideGroup}',
+ enabled: true,
+ assertions: 'all',
+ },
// IndeterminateCheckbox needs no skip: the component sets the native
// `.indeterminate` property and no aria-checked attribute (#49053), so
// axe's aria-conditional-attr passes.
From b017aeca911042a0bcee3300cc5ccae9e4e9a160 Mon Sep 17 00:00:00 2001
From: michel
Date: Thu, 29 Oct 2026 15:59:00 +0100
Subject: [PATCH 2/8] Address review feedback
Co-Authored-By: Claude Opus 5.5
---
.../src/ButtonGroup/ButtonGroup.test.js | 60 ++++++++++---------
.../src/ButtonGroup/accessibility.md | 13 ++--
scripts/a11yScorecard/index.mjs | 5 +-
scripts/a11yScorecard/rollup.mjs | 5 +-
scripts/a11yScorecard/validate.mjs | 17 +++++-
.../button-group/ButtonGroupA11yWideGroup.js | 5 +-
test/regressions/demoMeta.ts | 2 +-
7 files changed, 65 insertions(+), 42 deletions(-)
diff --git a/packages/mui-material/src/ButtonGroup/ButtonGroup.test.js b/packages/mui-material/src/ButtonGroup/ButtonGroup.test.js
index 2be31c541b871e..548f9e2a4360b4 100644
--- a/packages/mui-material/src/ButtonGroup/ButtonGroup.test.js
+++ b/packages/mui-material/src/ButtonGroup/ButtonGroup.test.js
@@ -1,12 +1,6 @@
import { describe, it, expect } from 'vitest';
import * as React from 'react';
-import {
- createRenderer,
- screen,
- simulateKeyboardDevice,
- isJsdom,
- within,
-} from '@mui/internal-test-utils';
+import { createRenderer, screen, simulateKeyboardDevice, isJsdom } from '@mui/internal-test-utils';
import ButtonGroup, { buttonGroupClasses as classes } from '@mui/material/ButtonGroup';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import Button, { buttonClasses } from '@mui/material/Button';
@@ -375,36 +369,36 @@ describe('', () => {
describe('WCAG 2.2 conformance', () => {
describe('1.3.1 Info and Relationships', () => {
- it('exposes the buttons as one group', () => {
+ it('puts the buttons inside the group element', () => {
render(
-
+ ,
);
- const group = screen.getByRole('group', { name: 'Text alignment' });
- expect(within(group).getAllByRole('button')).to.have.length(2);
+ const group = screen.getByRole('group');
+ screen.getAllByRole('button').forEach((button) => {
+ expect(group).to.contain(button);
+ });
});
});
describe('2.4.3 Focus Order', () => {
- ['horizontal', 'vertical'].forEach((orientation) => {
- it(`moves through a ${orientation} group in DOM order`, async () => {
- const { user } = render(
-
-
-
-
- ,
- );
-
- for (const name of ['One', 'Two', 'Three']) {
- // eslint-disable-next-line no-await-in-loop
- await user.tab();
- expect(screen.getByRole('button', { name })).toHaveFocus();
- }
- });
+ it('moves through the buttons in DOM order', async () => {
+ const { user } = render(
+
+
+
+
+ ,
+ );
+
+ for (const name of ['One', 'Two', 'Three']) {
+ // eslint-disable-next-line no-await-in-loop
+ await user.tab();
+ expect(screen.getByRole('button', { name })).toHaveFocus();
+ }
});
it('removes the buttons of a disabled group from the tab order', async () => {
@@ -472,6 +466,18 @@ describe('', () => {
expect(button).to.have.property('disabled', true);
});
});
+
+ it('keeps a button enabled when it sets disabled={false} in a disabled group', () => {
+ render(
+
+
+
+ ,
+ );
+
+ expect(screen.getByRole('button', { name: 'One' })).to.have.property('disabled', false);
+ expect(screen.getByRole('button', { name: 'Two' })).to.have.property('disabled', true);
+ });
});
});
});
diff --git a/packages/mui-material/src/ButtonGroup/accessibility.md b/packages/mui-material/src/ButtonGroup/accessibility.md
index 25465ff6acede9..a6186c17ebb021 100644
--- a/packages/mui-material/src/ButtonGroup/accessibility.md
+++ b/packages/mui-material/src/ButtonGroup/accessibility.md
@@ -56,7 +56,7 @@ A ButtonGroup puts several Buttons in one set. This report rates only what the g
- The dividers between the buttons have these contrasts against the adjacent colors, in light mode:
- - `outlined` and `text`: the `main` color at `50%` on a white page, `1.77:1` (`warning`) to `2.39:1` (`secondary`). With `color="inherit"`, `1.74:1`.
+ - `outlined` and `text`: the `main` color at `50%` on a white page, `1.76:1` (`warning`) to `2.39:1` (`secondary`). With `color="inherit"`, `1.74:1`.
- `contained`: the `dark` color between two `main` fills, `1.13:1` (`error`) to `1.92:1` (`info`). With `color="inherit"`, `grey[400]` on `grey[300]` is `1.42:1`.
- In an `outlined` group, the divider is the border of the next button. So the `outlined` border has the same contrast.
- WCAG does not require a boundary when text or an icon identifies the control (Understanding 1.4.11). Each button has its own label, so the dividers do not need `3:1`.
@@ -101,7 +101,7 @@ Tested by: unit `ButtonGroup.test.js`
-- The root has `role="group"`, so assistive technology reports the buttons as one set. A unit test confirms the role. An author can replace it with the `role` prop.
+- The root has `role="group"`, so assistive technology reports the buttons as one set. A unit test confirms that the buttons are inside the group element. An author can replace it with the `role` prop.
- The author names the group with `aria-label` or `aria-labelledby`. The component does not warn when the name is missing. A group without a name still conveys the grouping.
**Manual testing steps**
@@ -146,7 +146,8 @@ Tested by: unit `ButtonGroup.test.js` · axe-core `aria-allowed-attr` ✅, `aria
-- The group has `role="group"` and the name from `aria-label`. `disabled` on the group disables each button that does not set its own `disabled` prop. Unit tests confirm this. The axe-core ARIA rules pass on the demos.
+- The group has `role="group"` and the name from `aria-label`. `disabled` on the group disables each button that does not set its own `disabled` prop. A button with `disabled={false}` stays enabled. Unit tests confirm this. The axe-core ARIA rules pass on the demos.
+- The group does not keep a pressed or selected state. For a set of toggles, the author sets `aria-pressed` on each button, as in the `ButtonGroupA11ySemanticStates` fixture, or uses ToggleButtonGroup. axe-core checks these attributes on the fixture.
- In a split button, the author sets `aria-haspopup="menu"`, `aria-expanded`, and `aria-label` on the arrow button. The SplitButton demo and the `ButtonGroupA11ySemanticStates` fixture show this pattern.
**Manual testing steps**
@@ -184,8 +185,8 @@ Tested by: Playwright
-- A horizontal group is an `inline-flex` row that does not wrap. When the group is too wide, each button wraps its label first. When that is not enough, the page scrolls horizontally.
-- A Playwright test confirms that the three-button variant demo does not scroll at 320 px. A browser probe measured the `ButtonGroupA11yWideGroup` fixture, with five buttons: the page scrolls horizontally by about 126 px at 320 px.
+- A horizontal group is an `inline-flex` row that does not wrap. When the group is too wide, each button wraps its label first. When that is not enough, the group overflows its container, and the page scrolls horizontally.
+- A Playwright test confirms that the three-button variant demo does not scroll at 320 px. A screenshot records the `ButtonGroupA11yWideGroup` fixture, with five buttons, at 320 px. The test viewer hides horizontal overflow, so the screenshot shows the group clipped at the right edge.
- The number of buttons is an author decision. To fix a wide group, set `orientation="vertical"` on small screens, for example with `useMediaQuery`.
@@ -210,7 +211,7 @@ Tested by: unit `ButtonGroup.test.js`
-- Each button is a tab stop in DOM order, in both orientations. A disabled group removes its buttons from the tab order. Unit tests confirm this. For the manual check, see 1.3.2.
+- Each button is a tab stop in DOM order. `orientation` changes only the layout, so the order is the same in both orientations. A disabled group removes its buttons from the tab order. Unit tests confirm this. For the manual check, see 1.3.2.
diff --git a/scripts/a11yScorecard/index.mjs b/scripts/a11yScorecard/index.mjs
index 71f8f1169420cc..45b96fbcaa629e 100644
--- a/scripts/a11yScorecard/index.mjs
+++ b/scripts/a11yScorecard/index.mjs
@@ -113,8 +113,11 @@ async function run(argv) {
version,
summary: summarize(report.criteria),
}));
+ const byComponent = new Map(reports.map((report) => [report.component, report]));
fail([
- ...reports.flatMap((report) => validateReport(report, check)),
+ ...reports.flatMap((report) =>
+ validateReport(report, check, defaults, byComponent.get(report.data.inherits)),
+ ),
...validateKnownGaps(knownGaps, reports, check),
]);
const criteria = rollUpCriteria(reports);
diff --git a/scripts/a11yScorecard/rollup.mjs b/scripts/a11yScorecard/rollup.mjs
index 41807ffd17c586..6a3b4cf3283485 100644
--- a/scripts/a11yScorecard/rollup.mjs
+++ b/scripts/a11yScorecard/rollup.mjs
@@ -22,8 +22,9 @@ const ratingOf = (fields) => Object.fromEntries(RATING_KEYS.map((key) => [key, f
* criterion unless its own `notApplicable` lists it or it is not applicable by
* default. Keying a default not-applicable criterion in `criteria` rates it. A
* component with `inherits` rates only the criteria it keys, and inherits the
- * rest that its parent rates, including default not-applicable ones. It cannot
- * list those in `notApplicable`.
+ * rest that its parent rates, including default not-applicable ones. Its own
+ * `notApplicable` takes precedence over both, so it can opt out of a criterion
+ * that the parent rates.
*/
function resolveReport(source, defaults, resolveParent) {
const { component, data, regions, axe, ownTests, extraTests } = source;
diff --git a/scripts/a11yScorecard/validate.mjs b/scripts/a11yScorecard/validate.mjs
index 5bea0df0ed0eea..60b31a2a53b470 100644
--- a/scripts/a11yScorecard/validate.mjs
+++ b/scripts/a11yScorecard/validate.mjs
@@ -184,7 +184,8 @@ export async function validateSource(source, defaults) {
for (const number of ownNotApplicable) {
if (!defaults.data.criteria[number]) {
violations.push(`notApplicable: ${number} is not a WCAG 2.2 Level A or AA criterion`);
- } else if (defaults.data.criteria[number].notApplicable) {
+ } else if (defaults.data.criteria[number].notApplicable && !data.inherits) {
+ // `validateReport` checks an inheriting component against its parent.
violations.push(`notApplicable: ${number} is already not applicable by default`);
}
}
@@ -304,11 +305,23 @@ export function validateKnownGaps(knownGaps, reports, check) {
/**
* Returns every problem in one resolved report, prefixed with the component
* name. With `check`, the prose the report needs must also be written.
+ * `parent` is the resolved report that `inherits` names, if any.
*/
-export function validateReport(report, check) {
+export function validateReport(report, check, defaults, parent) {
const { component, data, regions } = report;
const violations = [];
+ // An inheriting component can opt out of a default not-applicable criterion
+ // only when its parent rates that criterion.
+ if (parent) {
+ const parentRates = new Set(parent.criteria.map(({ number }) => number));
+ for (const number of data.notApplicable ?? []) {
+ if (defaults.data.criteria[number]?.notApplicable && !parentRates.has(number)) {
+ violations.push(`notApplicable: ${number} is already not applicable by default`);
+ }
+ }
+ }
+
for (const number of report.unaccounted) {
violations.push(`${number} is not rated, inherited, or not applicable`);
}
diff --git a/test/regressions/a11y/fixtures/button-group/ButtonGroupA11yWideGroup.js b/test/regressions/a11y/fixtures/button-group/ButtonGroupA11yWideGroup.js
index b7145c61d06004..4f60e67f8f1739 100644
--- a/test/regressions/a11y/fixtures/button-group/ButtonGroupA11yWideGroup.js
+++ b/test/regressions/a11y/fixtures/button-group/ButtonGroupA11yWideGroup.js
@@ -1,9 +1,8 @@
import Button from '@mui/material/Button';
import ButtonGroup from '@mui/material/ButtonGroup';
-// A horizontal group with more buttons than fit at 320 CSS px. The group does
-// not wrap its buttons, so the page scrolls horizontally. The screenshot at
-// 320 px records this author concern (1.4.10); see ButtonGroup/accessibility.md.
+// A horizontal group wider than 320 CSS px (1.4.10). The group does not wrap.
+// The test viewer hides horizontal overflow, so the screenshot shows it clipped.
export default function ButtonGroupA11yWideGroup() {
return (
diff --git a/test/regressions/demoMeta.ts b/test/regressions/demoMeta.ts
index a0d70ee4e2aada..0caadecf0bc05f 100644
--- a/test/regressions/demoMeta.ts
+++ b/test/regressions/demoMeta.ts
@@ -179,7 +179,7 @@ export const SCREENSHOT_RULES: ScreenshotRule[] = [
test: 'test/regressions/a11y/fixtures/button-group/ButtonGroupA11yWideGroup',
enabled: true,
viewportWidth: 320,
- }, // Visual record of a wide horizontal group at 320 CSS px (1.4.10)
+ }, // Visual record of a wide horizontal group, clipped at 320 CSS px (1.4.10)
{
test: 'test/regressions/a11y/fixtures/toggle-button/ToggleButtonA11yTextSpacing',
enabled: true,
From 941b02750cde143542b9949124c439ca7891c3e7 Mon Sep 17 00:00:00 2001
From: michel
Date: Fri, 27 Nov 2026 10:34:20 +0100
Subject: [PATCH 3/8] adjusted the support ratings for buttongroup
---
packages/mui-material/src/ButtonGroup/accessibility.json | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/packages/mui-material/src/ButtonGroup/accessibility.json b/packages/mui-material/src/ButtonGroup/accessibility.json
index 4e9ab0ce5ec7b0..07bb0392fc3fe7 100644
--- a/packages/mui-material/src/ButtonGroup/accessibility.json
+++ b/packages/mui-material/src/ButtonGroup/accessibility.json
@@ -5,10 +5,9 @@
"1.3.1": {},
"1.3.2": { "responsibility": "Shared", "flagged": true },
"1.4.4": {},
- "1.4.10": {},
+ "1.4.10": { "conformance": "Partially Supports" },
"1.4.11": { "group": "Manual" },
"1.4.12": {},
- "2.4.3": {},
"2.4.6": { "group": "Manual", "flagged": true },
"2.4.7": {},
"4.1.2": {}
From 3c9d73a2fd2e61bf97f21e8045967fbe43e3c201 Mon Sep 17 00:00:00 2001
From: michel
Date: Fri, 27 Nov 2026 10:38:18 +0100
Subject: [PATCH 4/8] updated a11y docs according to review and new tests
---
.../src/ButtonGroup/accessibility.md | 29 +++++++------------
1 file changed, 10 insertions(+), 19 deletions(-)
diff --git a/packages/mui-material/src/ButtonGroup/accessibility.md b/packages/mui-material/src/ButtonGroup/accessibility.md
index c4adafe2d201da..fd08ff083f6065 100644
--- a/packages/mui-material/src/ButtonGroup/accessibility.md
+++ b/packages/mui-material/src/ButtonGroup/accessibility.md
@@ -12,18 +12,20 @@ A ButtonGroup puts several Buttons in one set. This report rates only what the g
| Result | Count |
| :----------------------- | :---- |
-| ✅ Supports | 9 |
-| ⚠️ Partially Supports | 1 |
+| ✅ Supports | 7 |
+| ⚠️ Partially Supports | 2 |
| ❌ Does Not Support | 0 |
| ➖ Not Applicable | 27 |
-| ↗ Inherited (see Button) | 18 |
-| 🚩 Flagged | 3/10 |
+| ↗ Inherited (see Button) | 19 |
+| 🚩 Flagged | 3/9 |
## Known gaps
-- ⚠️ **1.4.11 Non-text Contrast.** The buttons keep the Button focus ripple as their default focus indicator. Its contrast can fall below `3:1`. `disableRipple` or `disableFocusRipple` on the group removes it from each button.
+- ⚠️ **1.4.10 Reflow.** A horizontal group does not wrap. A wide group makes the page scroll horizontally at 320 px. Set `orientation="vertical"` on small screens.
+- ⚠️ **1.4.11 Non-text Contrast.** The buttons keep the Button focus ripple as their default focus indicator. Its contrast can fall below `3:1`. Enable `focusVisible` in the theme to get a ring. Avoid `disableRipple` and `disableFocusRipple` on the group, because they remove the indicator from every button.
- Inherits ⚠️ **1.4.3 Contrast (Minimum)** from [Button](../Button/accessibility.md).
- Inherits ⚠️ **2.2.2 Pause, Stop, Hide** from [Button](../Button/accessibility.md).
+- Inherits ⚠️ **2.4.3 Focus Order** from [Button](../Button/accessibility.md).
- Inherits ⚠️ **4.1.3 Status Messages** from [Button](../Button/accessibility.md).
## Success criteria
@@ -180,7 +182,7 @@ Tested by: Playwright
#### 1.4.10 Reflow · AA
-`✅ Supports` · `◐ Shared`
+`⚠️ Partially Supports` · `◐ Shared`
Tested by: Playwright
@@ -188,7 +190,7 @@ Tested by: Playwright
- A horizontal group is an `inline-flex` row that does not wrap. When the group is too wide, each button wraps its label first. When that is not enough, the group overflows its container, and the page scrolls horizontally.
- A Playwright test confirms that the three-button variant demo does not scroll at 320 px. A screenshot records the `ButtonGroupA11yWideGroup` fixture, with five buttons, at 320 px. The test viewer hides horizontal overflow, so the screenshot shows the group clipped at the right edge.
-- The number of buttons is an author decision. To fix a wide group, set `orientation="vertical"` on small screens, for example with `useMediaQuery`.
+- The component does not reflow a wide horizontal group, so the rating is Partially Supports. To fix a wide group, set `orientation="vertical"` on small screens, for example with `useMediaQuery`.
@@ -204,18 +206,6 @@ Tested by: Playwright
-#### 2.4.3 Focus Order · A
-
-`✅ Supports` · `◐ Shared`
-
-Tested by: unit `ButtonGroup.test.js`
-
-
-
-- Each button is a tab stop in DOM order. `orientation` changes only the layout, so the order is the same in both orientations. A disabled group removes its buttons from the tab order. Unit tests confirm this. For the manual check, see 1.3.2.
-
-
-
## Inherited from Button
- **1.1.1 Non-text Content (A).**
@@ -226,6 +216,7 @@ Tested by: unit `ButtonGroup.test.js`
- **2.1.1 Keyboard (A).**
- **2.1.2 No Keyboard Trap (A).**
- **2.2.2 Pause, Stop, Hide (A).**
+- **2.4.3 Focus Order (A).** Each button is a tab stop in DOM order, in both orientations. A disabled group removes its buttons from the tab order. Unit tests in `ButtonGroup.test.js` confirm this.
- **2.4.4 Link Purpose (In Context) (A).** A grouped Button with `href`. The `ButtonGroupA11ySemanticStates` fixture has one, and axe-core `link-name` passes on it.
- **2.4.11 Focus Not Obscured (Minimum) (AA).**
- **2.5.2 Pointer Cancellation (A).**
From 296d574e74f026734674424946105d8f2eac2998 Mon Sep 17 00:00:00 2001
From: michel
Date: Fri, 27 Nov 2026 10:39:24 +0100
Subject: [PATCH 5/8] changed the support entries in the overwview
---
packages/mui-material/src/accessibility.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/mui-material/src/accessibility.md b/packages/mui-material/src/accessibility.md
index a84eb244ab500f..6dabb978205ad2 100644
--- a/packages/mui-material/src/accessibility.md
+++ b/packages/mui-material/src/accessibility.md
@@ -187,7 +187,7 @@ Edit the JSON files, not this table.
| [AccordionSummary](./AccordionSummary/accessibility.md) | 23 | 1 | 0 | 31 | — | 3/24 |
| [Avatar](./Avatar/accessibility.md) | 9 | 2 | 0 | 44 | — | 5/11 |
| [Button](./Button/accessibility.md) | 23 | 5 | 0 | 27 | — | 9/28 |
-| [ButtonGroup](./ButtonGroup/accessibility.md) | 9 | 1 | 0 | 27 | 18 | 3/10 |
+| [ButtonGroup](./ButtonGroup/accessibility.md) | 7 | 2 | 0 | 27 | 19 | 3/9 |
| [Checkbox](./Checkbox/accessibility.md) | 24 | 1 | 0 | 30 | — | 3/25 |
| [CircularProgress](./CircularProgress/accessibility.md) | 8 | 3 | 0 | 44 | — | 5/11 |
| [IconButton](./IconButton/accessibility.md) | 22 | 5 | 0 | 28 | — | 9/27 |
@@ -198,7 +198,7 @@ Edit the JSON files, not this table.
| [Switch](./Switch/accessibility.md) | 24 | 1 | 0 | 30 | — | 2/25 |
| [TextField](./TextField/accessibility.md) | 25 | 3 | 0 | 27 | — | 4/28 |
| [ToggleButton](./ToggleButton/accessibility.md) | 21 | 3 | 0 | 31 | — | 2/24 |
-| [ToggleButtonGroup](./ToggleButtonGroup/accessibility.md) | 4 | 0 | 0 | 31 | 20 | 1/4 |
+| [ToggleButtonGroup](./ToggleButtonGroup/accessibility.md) | 3 | 1 | 0 | 31 | 20 | 1/4 |
From 8b13e9e27fd8208b5dfca57f692fa18a0ac12023 Mon Sep 17 00:00:00 2001
From: michel
Date: Fri, 27 Nov 2026 10:39:56 +0100
Subject: [PATCH 6/8] updated supported entries in the togglebuttongroup docs
and added the new gap
---
.../mui-material/src/ToggleButtonGroup/accessibility.md | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/packages/mui-material/src/ToggleButtonGroup/accessibility.md b/packages/mui-material/src/ToggleButtonGroup/accessibility.md
index 59826e2e21756f..73458180620da2 100644
--- a/packages/mui-material/src/ToggleButtonGroup/accessibility.md
+++ b/packages/mui-material/src/ToggleButtonGroup/accessibility.md
@@ -14,8 +14,8 @@ Unlike a radio group, ToggleButtonGroup adds no roving tab order and no arrow-ke
| Result | Count |
| :------------------------------ | :---- |
-| ✅ Supports | 4 |
-| ⚠️ Partially Supports | 0 |
+| ✅ Supports | 3 |
+| ⚠️ Partially Supports | 1 |
| ❌ Does Not Support | 0 |
| ➖ Not Applicable | 31 |
| ↗ Inherited (see Toggle Button) | 20 |
@@ -23,6 +23,7 @@ Unlike a radio group, ToggleButtonGroup adds no roving tab order and no arrow-ke
## Known gaps
+- ⚠️ **1.4.10 Reflow.** A horizontal group does not wrap. A wide group makes the page scroll horizontally at 320 px. Set `orientation="vertical"` on small screens.
- Inherits ⚠️ **1.4.1 Use of Color** from [Toggle Button](../ToggleButton/accessibility.md).
- Inherits ⚠️ **1.4.3 Contrast (Minimum)** from [Toggle Button](../ToggleButton/accessibility.md).
- Inherits ⚠️ **1.4.11 Non-text Contrast** from [Toggle Button](../ToggleButton/accessibility.md).
@@ -97,14 +98,14 @@ Tested by: unit `ToggleButtonGroup.test.js` · axe-core `aria-allowed-attr` ✅,
#### 1.4.10 Reflow · AA
-`✅ Supports` · `◐ Shared`
+`⚠️ Partially Supports` · `◐ Shared`
Tested by: Playwright
- Each toggle sizes to its content, but the group owns the layout: a horizontal group is `display: inline-flex` and does not wrap (`ToggleButtonGroup.js`), so a wide row of toggles can overflow horizontally at 320 CSS pixels.
-- The component provides `orientation="vertical"` as the escape hatch; the author keeps the group within 320 pixels by switching orientation or limiting the number of toggles. Covered by a Playwright test at a 320px viewport.
+- The component does not reflow a wide horizontal group, so the rating is Partially Supports. To fix a wide group, set `orientation="vertical"` on small screens, or use fewer toggles. A Playwright test checks the demos at a 320px viewport.
From 928589ec988f6acd2e34932796d892b34af8a80d Mon Sep 17 00:00:00 2001
From: michel
Date: Fri, 27 Nov 2026 10:40:09 +0100
Subject: [PATCH 7/8] updated support entries
---
.../getting-started/accessibility/accessibility.md | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/docs/data/material/getting-started/accessibility/accessibility.md b/docs/data/material/getting-started/accessibility/accessibility.md
index 42e38eadcca680..7f29b885bce39c 100644
--- a/docs/data/material/getting-started/accessibility/accessibility.md
+++ b/docs/data/material/getting-started/accessibility/accessibility.md
@@ -41,7 +41,7 @@ Each row counts only the criteria that **apply** to that component; criteria tha
| [AccordionSummary](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/AccordionSummary/accessibility.md) | 13 | 11 | 24 | 23 | 1 | 21/24 | 11 |
| [Avatar](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Avatar/accessibility.md) | 5 | 6 | 11 | 9 | 2 | 6/11 | 2 |
| [Button](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Button/accessibility.md) | 16 | 12 | 28 | 23 | 5 | 19/28 | 10 |
-| [ButtonGroup](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ButtonGroup/accessibility.md) | 4 | 6 | 10 | 9 | 1 | 7/10 | 4 |
+| [ButtonGroup](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ButtonGroup/accessibility.md) | 3 | 6 | 9 | 7 | 2 | 6/9 | 3 |
| [Checkbox](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Checkbox/accessibility.md) | 14 | 11 | 25 | 24 | 1 | 22/25 | 11 |
| [CircularProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CircularProgress/accessibility.md) | 6 | 5 | 11 | 8 | 3 | 6/11 | 1 |
| [IconButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/IconButton/accessibility.md) | 15 | 12 | 27 | 22 | 5 | 18/27 | 9 |
@@ -52,7 +52,7 @@ Each row counts only the criteria that **apply** to that component; criteria tha
| [Switch](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Switch/accessibility.md) | 14 | 11 | 25 | 24 | 1 | 23/25 | 11 |
| [TextField](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/TextField/accessibility.md) | 14 | 14 | 28 | 25 | 3 | 24/28 | 12 |
| [ToggleButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ToggleButton/accessibility.md) | 13 | 11 | 24 | 21 | 3 | 22/24 | 11 |
-| [ToggleButtonGroup](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ToggleButtonGroup/accessibility.md) | 2 | 2 | 4 | 4 | 0 | 3/4 | 1 |
+| [ToggleButtonGroup](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ToggleButtonGroup/accessibility.md) | 2 | 2 | 4 | 3 | 1 | 3/4 | 1 |
@@ -60,7 +60,7 @@ Each row counts only the criteria that **apply** to that component; criteria tha
**No component records a ❌ Does Not Support rating for any Level A or AA criterion.**
-Rolled up to the library level, where each criterion takes the worst rating any assessed component receives, 32 success criteria are exercised: **26 Supports, 6 Partially Supports, 0 Does Not Support.**
+Rolled up to the library level, where each criterion takes the worst rating any assessed component receives, 32 success criteria are exercised: **25 Supports, 7 Partially Supports, 0 Does Not Support.**
@@ -91,6 +91,7 @@ Each ⚠️ rating comes from one of the issues below. Some of them can be fixed
| :------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------- |
| **By default, the keyboard focus indicator is the ripple or a background tint, and its contrast can fall below 3:1** | [1.4.11 Non-text Contrast](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html) | [AccordionSummary](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/AccordionSummary/accessibility.md) [Button](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Button/accessibility.md) [ButtonGroup](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ButtonGroup/accessibility.md) [Checkbox](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Checkbox/accessibility.md) [IconButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/IconButton/accessibility.md) (the ring needs `disableFocusRipple` too) [Radio](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Radio/accessibility.md) [Switch](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Switch/accessibility.md) [ToggleButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ToggleButton/accessibility.md) | Enable `focusVisible` in your theme — see below |
| **Some default palette colors fall short of contrast minimums** | [1.4.3 Contrast (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html) [1.4.11 Non-text Contrast](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html) | [Avatar](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Avatar/accessibility.md) [Button](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Button/accessibility.md) [CircularProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CircularProgress/accessibility.md) (`warning` with `enableTrackSlot`) [IconButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/IconButton/accessibility.md) (`info`, `warning`) [LinearProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/LinearProgress/accessibility.md) [Link](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Link/accessibility.md) (link text, 1.4.3 only) [Switch](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Switch/accessibility.md) [TextField](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/TextField/accessibility.md) [ToggleButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ToggleButton/accessibility.md) | Override the affected palette entries |
+| **A horizontal group does not wrap, so a wide group can scroll horizontally at 320 px** | [1.4.10 Reflow](https://www.w3.org/WAI/WCAG22/Understanding/reflow.html) | [ButtonGroup](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ButtonGroup/accessibility.md) [ToggleButtonGroup](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ToggleButtonGroup/accessibility.md) | Set `orientation="vertical"` on small screens |
| **The selected state of colored Toggle Buttons is conveyed almost entirely by hue** | [1.4.1 Use of Color](https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html) | [ToggleButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ToggleButton/accessibility.md) (`primary`, `error`, `info`, `success`) | Add a non-color cue to the selected state, such as an icon |
| **Links without an underline rely on color, and several link colors are below 3:1 against body text** | [1.4.1 Use of Color](https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html) | [Link](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Link/accessibility.md) (`underline="none"`, `underline="hover"`) | Keep the default `underline="always"` for links in body text |
| **Dynamic state changes are not announced** | [4.1.3 Status Messages](https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html) | [Button](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Button/accessibility.md) (`loading`) [CircularProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CircularProgress/accessibility.md) [IconButton](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/IconButton/accessibility.md) (`loading`) [LinearProgress](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/LinearProgress/accessibility.md) [TextField](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/TextField/accessibility.md) (error) | Render your own `aria-live` region alongside |
From 06b461a5fcf462b4d89175595861d548429c7c88 Mon Sep 17 00:00:00 2001
From: michel
Date: Fri, 27 Nov 2026 10:45:06 +0100
Subject: [PATCH 8/8] fixed test setup and updated json files with new values
---
.../button-group/button-group.a11y.json | 52 ---------------
.../accessibility/knownGaps.json | 6 ++
.../accessibility/scorecard.json | 65 ++++++++++---------
.../src/ToggleButtonGroup/accessibility.json | 2 +-
scripts/a11yScorecard/index.mjs | 5 +-
scripts/a11yScorecard/rollup.mjs | 2 +
scripts/a11yScorecard/validate.mjs | 8 +--
test/regressions/demoMeta.test.ts | 4 +-
test/regressions/demoMeta.ts | 8 ++-
9 files changed, 56 insertions(+), 96 deletions(-)
diff --git a/docs/data/material/components/button-group/button-group.a11y.json b/docs/data/material/components/button-group/button-group.a11y.json
index 62f5d05129e89b..7d811e2e21a8b7 100644
--- a/docs/data/material/components/button-group/button-group.a11y.json
+++ b/docs/data/material/components/button-group/button-group.a11y.json
@@ -111,58 +111,6 @@
}
}
},
- "ButtonGroupA11yWideGroup": {
- "rules": {
- "aria-allowed-attr": {
- "status": "pass",
- "tags": ["wcag2a"]
- },
- "aria-conditional-attr": {
- "status": "pass",
- "tags": ["wcag2a"]
- },
- "aria-deprecated-role": {
- "status": "pass",
- "tags": ["wcag2a"]
- },
- "aria-prohibited-attr": {
- "status": "pass",
- "tags": ["wcag2a"]
- },
- "aria-required-attr": {
- "status": "pass",
- "tags": ["wcag2a"]
- },
- "aria-roles": {
- "status": "pass",
- "tags": ["wcag2a"]
- },
- "aria-valid-attr": {
- "status": "pass",
- "tags": ["wcag2a"]
- },
- "aria-valid-attr-value": {
- "status": "pass",
- "tags": ["wcag2a"]
- },
- "button-name": {
- "status": "pass",
- "tags": ["wcag2a"]
- },
- "color-contrast": {
- "status": "pass",
- "tags": ["wcag2aa"]
- },
- "nested-interactive": {
- "status": "pass",
- "tags": ["wcag2a"]
- },
- "target-size": {
- "status": "pass",
- "tags": ["wcag22aa"]
- }
- }
- },
"DisableElevation": {
"rules": {
"aria-allowed-attr": {
diff --git a/docs/data/material/getting-started/accessibility/knownGaps.json b/docs/data/material/getting-started/accessibility/knownGaps.json
index a3ecacd60fcb81..803a6fdb730dbb 100644
--- a/docs/data/material/getting-started/accessibility/knownGaps.json
+++ b/docs/data/material/getting-started/accessibility/knownGaps.json
@@ -30,6 +30,12 @@
],
"workaround": "Override the affected palette entries"
},
+ {
+ "gap": "A horizontal group does not wrap, so a wide group can scroll horizontally at 320 px",
+ "criteria": ["1.4.10"],
+ "affected": ["ButtonGroup", "ToggleButtonGroup"],
+ "workaround": "Set `orientation=\"vertical\"` on small screens"
+ },
{
"gap": "The selected state of colored Toggle Buttons is conveyed almost entirely by hue",
"criteria": ["1.4.1"],
diff --git a/docs/data/material/getting-started/accessibility/scorecard.json b/docs/data/material/getting-started/accessibility/scorecard.json
index 514114b4ba0dfc..61b15db876b0f8 100644
--- a/docs/data/material/getting-started/accessibility/scorecard.json
+++ b/docs/data/material/getting-started/accessibility/scorecard.json
@@ -3,8 +3,8 @@
"componentCount": 16,
"totals": {
"rated": 32,
- "supports": 26,
- "partiallySupports": 6,
+ "supports": 25,
+ "partiallySupports": 7,
"doesNotSupport": 0,
"flagged": 14
},
@@ -85,9 +85,9 @@
"number": "1.4.10",
"name": "Reflow",
"level": "AA",
- "conformance": "Supports",
+ "conformance": "Partially Supports",
"flagged": false,
- "affected": []
+ "affected": ["ButtonGroup", "ToggleButtonGroup"]
},
{
"number": "1.4.11",
@@ -1168,15 +1168,20 @@
{
"component": "ButtonGroup",
"counts": {
- "supports": 9,
- "partiallySupports": 1,
+ "supports": 7,
+ "partiallySupports": 2,
"doesNotSupport": 0,
"notApplicable": 27,
- "inherited": 18,
+ "inherited": 19,
"flagged": 3,
- "rated": 10
+ "rated": 9
},
"gaps": [
+ {
+ "number": "1.4.10",
+ "name": "Reflow",
+ "conformance": "Partially Supports"
+ },
{
"number": "1.4.11",
"name": "Non-text Contrast",
@@ -1194,6 +1199,12 @@
"conformance": "Partially Supports",
"from": "Button"
},
+ {
+ "number": "2.4.3",
+ "name": "Focus Order",
+ "conformance": "Partially Supports",
+ "from": "Button"
+ },
{
"number": "4.1.3",
"name": "Status Messages",
@@ -1233,7 +1244,7 @@
"number": "1.4.10",
"name": "Reflow",
"level": "AA",
- "conformance": "Supports",
+ "conformance": "Partially Supports",
"responsibility": "Shared",
"group": "Automated",
"flagged": false
@@ -1256,15 +1267,6 @@
"group": "Automated",
"flagged": false
},
- {
- "number": "2.4.3",
- "name": "Focus Order",
- "level": "A",
- "conformance": "Supports",
- "responsibility": "Shared",
- "group": "Automated",
- "flagged": false
- },
{
"number": "2.4.6",
"name": "Headings and Labels",
@@ -1294,14 +1296,14 @@
}
],
"summary": {
- "rated": 10,
- "levelA": 4,
+ "rated": 9,
+ "levelA": 3,
"levelAA": 6,
- "supports": 9,
- "partiallySupports": 1,
+ "supports": 7,
+ "partiallySupports": 2,
"doesNotSupport": 0,
- "verified": 7,
- "automated": 4
+ "verified": 6,
+ "automated": 3
}
},
{
@@ -3537,8 +3539,8 @@
{
"component": "ToggleButtonGroup",
"counts": {
- "supports": 4,
- "partiallySupports": 0,
+ "supports": 3,
+ "partiallySupports": 1,
"doesNotSupport": 0,
"notApplicable": 31,
"inherited": 20,
@@ -3546,6 +3548,11 @@
"rated": 4
},
"gaps": [
+ {
+ "number": "1.4.10",
+ "name": "Reflow",
+ "conformance": "Partially Supports"
+ },
{
"number": "1.4.1",
"name": "Use of Color",
@@ -3579,7 +3586,7 @@
"number": "1.4.10",
"name": "Reflow",
"level": "AA",
- "conformance": "Supports",
+ "conformance": "Partially Supports",
"responsibility": "Shared",
"group": "Automated",
"flagged": false
@@ -3607,8 +3614,8 @@
"rated": 4,
"levelA": 2,
"levelAA": 2,
- "supports": 4,
- "partiallySupports": 0,
+ "supports": 3,
+ "partiallySupports": 1,
"doesNotSupport": 0,
"verified": 3,
"automated": 1
diff --git a/packages/mui-material/src/ToggleButtonGroup/accessibility.json b/packages/mui-material/src/ToggleButtonGroup/accessibility.json
index b2ab3a742dbb79..36cd4a018f49b9 100644
--- a/packages/mui-material/src/ToggleButtonGroup/accessibility.json
+++ b/packages/mui-material/src/ToggleButtonGroup/accessibility.json
@@ -3,7 +3,7 @@
"inherits": "ToggleButton",
"criteria": {
"1.3.1": {},
- "1.4.10": {},
+ "1.4.10": { "conformance": "Partially Supports" },
"2.4.6": { "group": "Manual", "flagged": true },
"4.1.2": {}
},
diff --git a/scripts/a11yScorecard/index.mjs b/scripts/a11yScorecard/index.mjs
index 45b96fbcaa629e..c83508bc041e7c 100644
--- a/scripts/a11yScorecard/index.mjs
+++ b/scripts/a11yScorecard/index.mjs
@@ -113,11 +113,8 @@ async function run(argv) {
version,
summary: summarize(report.criteria),
}));
- const byComponent = new Map(reports.map((report) => [report.component, report]));
fail([
- ...reports.flatMap((report) =>
- validateReport(report, check, defaults, byComponent.get(report.data.inherits)),
- ),
+ ...reports.flatMap((report) => validateReport(report, check, defaults)),
...validateKnownGaps(knownGaps, reports, check),
]);
const criteria = rollUpCriteria(reports);
diff --git a/scripts/a11yScorecard/rollup.mjs b/scripts/a11yScorecard/rollup.mjs
index 6a3b4cf3283485..7586c3e3823038 100644
--- a/scripts/a11yScorecard/rollup.mjs
+++ b/scripts/a11yScorecard/rollup.mjs
@@ -114,6 +114,8 @@ function resolveReport(source, defaults, resolveParent) {
.map(({ number }) => parentRated.get(number))
.filter((criterion) => criterion.conformance !== 'Supports'),
},
+ // The criteria that the parent rates. `validateReport` reads it, so the two cannot drift.
+ parentRates,
playwright: [...playwright],
unaccounted: WCAG_CRITERIA.filter(
({ number }) =>
diff --git a/scripts/a11yScorecard/validate.mjs b/scripts/a11yScorecard/validate.mjs
index 60b31a2a53b470..6e0fbbd6877d41 100644
--- a/scripts/a11yScorecard/validate.mjs
+++ b/scripts/a11yScorecard/validate.mjs
@@ -305,16 +305,14 @@ export function validateKnownGaps(knownGaps, reports, check) {
/**
* Returns every problem in one resolved report, prefixed with the component
* name. With `check`, the prose the report needs must also be written.
- * `parent` is the resolved report that `inherits` names, if any.
*/
-export function validateReport(report, check, defaults, parent) {
- const { component, data, regions } = report;
+export function validateReport(report, check, defaults) {
+ const { component, data, regions, parentRates } = report;
const violations = [];
// An inheriting component can opt out of a default not-applicable criterion
// only when its parent rates that criterion.
- if (parent) {
- const parentRates = new Set(parent.criteria.map(({ number }) => number));
+ if (data.inherits) {
for (const number of data.notApplicable ?? []) {
if (defaults.data.criteria[number]?.notApplicable && !parentRates.has(number)) {
violations.push(`notApplicable: ${number} is already not applicable by default`);
diff --git a/test/regressions/demoMeta.test.ts b/test/regressions/demoMeta.test.ts
index a2fa111ca261e8..fcb0ab89a4d8af 100644
--- a/test/regressions/demoMeta.test.ts
+++ b/test/regressions/demoMeta.test.ts
@@ -118,10 +118,10 @@ describe('getConfig', () => {
});
});
- it('records the wide ButtonGroup fixture at 320 px', () => {
+ it('records the wide ButtonGroup fixture at 320 px, without axe', () => {
expect(
getConfig(A11Y_RULES, 'test/regressions/a11y/fixtures/button-group/ButtonGroupA11yWideGroup'),
- ).to.deep.include({ enabled: true, assertions: 'all' });
+ ).to.equal(undefined);
expect(
getConfig(
SCREENSHOT_RULES,
diff --git a/test/regressions/demoMeta.ts b/test/regressions/demoMeta.ts
index 9a0635db6cb32f..7e80d9bcb9695d 100644
--- a/test/regressions/demoMeta.ts
+++ b/test/regressions/demoMeta.ts
@@ -453,10 +453,12 @@ export const A11Y_RULES: A11yRule[] = [
enabled: true,
assertions: 'all',
},
- // A11y-only fixtures under `test/regressions/a11y/fixtures/button-group/`; the
- // suite name maps their results into the same `button-group.a11y.json`.
+ // An a11y-only fixture under `test/regressions/a11y/fixtures/button-group/`; the
+ // suite name maps its results into the same `button-group.a11y.json`.
+ // `ButtonGroupA11yWideGroup` is not enrolled. It has only plain buttons, and
+ // it exists only for the 320 px screenshot.
{
- test: 'test/regressions/a11y/fixtures/button-group/{ButtonGroupA11ySemanticStates,ButtonGroupA11yWideGroup}',
+ test: 'test/regressions/a11y/fixtures/button-group/ButtonGroupA11ySemanticStates',
enabled: true,
assertions: 'all',
},