Skip to content

[Switch] Add role="switch" #46482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ZeeshanTamboli
Copy link
Member

Closes #23216

Adds role="switch" to the input element to improve accessibility.

Tested with NVDA—now announces "on/off" instead of "checked/unchecked".

@ZeeshanTamboli ZeeshanTamboli added accessibility a11y component: switch This is the name of the generic UI component, not the React module! labels Jul 3, 2025
@mui-bot
Copy link

mui-bot commented Jul 3, 2025

Netlify deploy preview

Bundle size report

Bundle Parsed Size Gzip Size
@mui/material 🔺+22B(0.00%) 🔺+10B(+0.01%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against c2b4f83

@ZeeshanTamboli ZeeshanTamboli merged commit 04b87f3 into mui:master Jul 4, 2025
23 checks passed
@ZeeshanTamboli ZeeshanTamboli deleted the issue-23216-add-role-switch branch July 4, 2025 13:43
yafeng-c pushed a commit to yafeng-c/material-ui that referenced this pull request Jul 5, 2025
[Switch] Add role="switch" (mui#46482)

fix again

update new tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y component: switch This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Switch] Use role="switch"
3 participants