Skip to content

[Checkbox][Radio][Switch] Remove deprecated inputProps and inputRef#48059

Merged
mj12albert merged 7 commits intomui:masterfrom
siriwatknp:remove-deprecated-switchbase-props
Mar 23, 2026
Merged

[Checkbox][Radio][Switch] Remove deprecated inputProps and inputRef#48059
mj12albert merged 7 commits intomui:masterfrom
siriwatknp:remove-deprecated-switchbase-props

Conversation

@siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Mar 23, 2026

Summary

Remove deprecated inputProps and inputRef props from SwitchBase (internal component used by Checkbox, Radio, and Switch).

Added codemods for Checkbox, Radio and Switch

Breaking changes

  • inputProps prop removed — use slotProps.input instead
  • inputRef prop removed — use slotProps.input.ref instead

Affects: Checkbox, Radio, Switch

 <Checkbox
-  inputProps={{ 'aria-label': 'Checkbox' }}
-  inputRef={ref}
+  slotProps={{ input: { 'aria-label': 'Checkbox', ref } }}
 />

Relates to #47987

@siriwatknp siriwatknp added breaking change Introduces changes that are not backward compatible. package: material-ui Specific to Material UI. labels Mar 23, 2026
@mui-bot
Copy link

mui-bot commented Mar 23, 2026

Netlify deploy preview

Bundle size report

Bundle Parsed size Gzip size
@mui/material ▼-75B(-0.01%) ▼-40B(-0.03%)
@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 79220c3

@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged. labels Mar 23, 2026
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 23, 2026
@siriwatknp siriwatknp changed the title [SwitchBase] Remove deprecated inputProps and inputRef [Checkbox][Radio][Switch] Remove deprecated inputProps and inputRef Mar 23, 2026
@siriwatknp siriwatknp added scope: checkbox Changes related to the checkbox. scope: switch Changes related to the switch. scope: radio group Changes related to the radio group. labels Mar 23, 2026
@mj12albert mj12albert enabled auto-merge (squash) March 23, 2026 06:18
@mj12albert mj12albert merged commit 58cf9c2 into mui:master Mar 23, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Introduces changes that are not backward compatible. package: material-ui Specific to Material UI. scope: checkbox Changes related to the checkbox. scope: radio group Changes related to the radio group. scope: switch Changes related to the switch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants