[material-ui][system] Remove deprecated system props from Box, Stack, Typography#48072
Merged
siriwatknp merged 31 commits intomui:masterfrom Mar 25, 2026
Merged
Conversation
… Typography Remove extendSxProp from Box (createBox), Stack (createStack), Typography. Remove SystemProps from type definitions (BoxOwnProps, StackOwnProps, StackProps, TypographyOwnProps). Remove internal_createExtendSxProp from zero-styled. Update all tests, docs demos, and type specs to use sx prop. Update migration guide.
Netlify deploy preview
Bundle size report
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…eline demos Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3a6344f to
427c447
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
System props are removed, so color is now only a component prop handled by styled variants in TypographyRoot. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
System props are removed, so the v5 color prop escape hatch that allowed arbitrary strings is no longer needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…it to Link color type Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Link now moves color="text.secondary", color="text.primary", etc. to sx while keeping named colors (primary, secondary, inherit) as component props. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The v6 codemod is for v5→v6 migration (system props deprecated). The v9 codemod is for v6→v9 migration (system props removed). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…cases to v9 codemod Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
mnajdova
reviewed
Mar 24, 2026
Member
mnajdova
left a comment
There was a problem hiding this comment.
Are the changes done via the codemod?
|
|
||
| it('combines system properties with the sx prop', () => { | ||
| const { container } = render(<Box mt={2} mr={1} sx={{ marginRight: 5, mb: 2 }} />); | ||
| it('applies system properties via the sx prop', () => { |
Member
There was a problem hiding this comment.
What's the point of the test? Don't we have other tests that test these values?
Member
Author
Yes, the new |
49 tasks
silviuaavram
approved these changes
Mar 24, 2026
| @@ -0,0 +1,61 @@ | |||
| import { Box as Boxxx, Grid as Griddd, Grid2 as Griddd2 } from '@mui/material'; | |||
Member
There was a problem hiding this comment.
why do we need to duplicate the last character?
Member
Author
There was a problem hiding this comment.
To ensure that if user import the component using alias, the codemod still account for.
Add ?. to .startsWith() and .match() calls in typographyColorMatcher
and Link matcher to prevent crashes when color prop is an expression
(e.g., color={someVar}) where val.value is undefined.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove deprecated system props support from Box, Stack, and Typography components, completing the last item in #47987.
extendSxPropusage fromcreateBox,createStack, andTypographySystemPropsfrom type definitions (BoxOwnProps,StackOwnProps,StackProps,TypographyOwnProps)v6ColorsandisSxColorcheck from Typography —coloris now only a component prop handled by styled variants(string & {})from Typographycolortype — arbitrary strings are no longer accepted, usesxinsteadinternal_createExtendSxPropfrom pigment-css package.jsonsxprop@typescript-to-proptypes-ignoreto ListItemTextslotPropsto prevent proptypes expansion of Typography fields'inherit'to Linkcolortype — Link explicitly handlescolor="inherit"for underline behaviorCodemod
A new
v9.0.0/system-propscodemod is added to automate the migration. It lives underv9.0.0(notv6.0.0) because in v6 system props were only deprecated — they still worked viaextendSxProp. In v9,extendSxPropis removed so system props no longer function and must be migrated tosx.The v9 codemod extends the v6 version with:
color="inherit"on Typography — moved tosxbecauseextendSxProppreviously resolved it as CSScolor: inherit. Without it, the value would be passed as a raw DOM attribute.color="text.secondary"on Link — moved tosx, while keeping named colors ("primary","secondary","inherit") as component props since Link handles them for underline styling.Closes part of #47987 (the "Remove deprecated system props support from all components" item under "Other deprecations").