Skip to content

[Slider] Remove deprecated props#47996

Merged
siriwatknp merged 10 commits intomui:masterfrom
siriwatknp:remove-deprecated-Slider-components
Mar 18, 2026
Merged

[Slider] Remove deprecated props#47996
siriwatknp merged 10 commits intomui:masterfrom
siriwatknp:remove-deprecated-Slider-components

Conversation

@siriwatknp
Copy link
Member

Summary

Remove the deprecated components and componentsProps props from the Slider component. Users should use slots and slotProps instead.

Breaking change

  • components prop removed → use slots
  • componentsProps prop removed → use slotProps

Migration:

 <Slider
-  components={{ Track: CustomTrack }}
-  componentsProps={{ track: { testid: 'test-id' } }}
+  slots={{ track: CustomTrack }}
+  slotProps={{ track: { testid: 'test-id' } }}
 />

Codemod:

npx @mui/codemod@latest deprecations/slider-props <path>

Test plan

  • TypeScript compilation passes
  • Unit tests pass (updated to use slots/slotProps)
  • pnpm proptypes && pnpm docs:api regenerated
  • Migration guide updated

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

mui-bot commented Mar 17, 2026

Netlify deploy preview

Bundle size report

Bundle Parsed size Gzip size
@mui/material ▼-459B(-0.09%) ▼-225B(-0.15%)
@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 bb62d64

@siriwatknp siriwatknp changed the title [material-ui][Slider] Remove deprecated components and componentsProps props [material-ui][Slider] Remove deprecated props Mar 17, 2026
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 17, 2026
const MarkSlot = slots?.mark ?? components.Mark ?? SliderMark;
const MarkLabelSlot = slots?.markLabel ?? components.MarkLabel ?? SliderMarkLabel;
const InputSlot = slots?.input ?? components.Input ?? 'input';
const RootSlot = slots?.root ?? SliderRoot;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really curious why in Slider we don't follow other components. Just pass elementType as the default one, then let the useSlot get what it needs from externalForwardedProps. Here we're manually getting the elementType, then the slotsProps, and then we pass them to useSlot.

I don't know which one is better, but from what I've seen in other components so far, we're letting useSlot handle all of this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's true.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 18, 2026
@siriwatknp siriwatknp changed the title [material-ui][Slider] Remove deprecated props [Slider] Remove deprecated props Mar 18, 2026
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 18, 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 18, 2026
@siriwatknp siriwatknp merged commit ac440fb into mui:master Mar 18, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants