Skip to content

Commit 1758f62

Browse files
[material-ui][docs] Audit and copyedit the v6 migration doc (#43073)
1 parent cee8714 commit 1758f62

File tree

11 files changed

+220
-177
lines changed

11 files changed

+220
-177
lines changed

docs/data/material/components/grid/grid.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The `Grid` component shouldn't be confused with a data grid; it is closer to a l
2020
:::
2121

2222
:::warning
23-
The `Grid` component has been deprecated. Please use the [Grid v2](/material-ui/react-grid2/) instead. See how to migrate in the [Grid v2 migration guide](/material-ui/migration/migration-grid-v2/) and [Material UI v6 migration guide](/material-ui/migration/migrating-to-v6/).
23+
The `Grid` component has been deprecated. Please use [Grid v2](/material-ui/react-grid2/) instead. See how to migrate in the [Grid v2 migration guide](/material-ui/migration/migration-grid-v2/) and [Material UI v6 upgrade guide](/material-ui/migration/upgrade-to-v6/).
2424
:::
2525

2626
## How it works

docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,51 @@ The composed CSS classes are going to be deprecated and eventually removed in fa
4040
For example, the `.MuiAccordionSummary-contentGutters` class was deprecated in favor of the `.MuiAccordionSummary-gutters` and `.MuiAccordionSummary-content` classes.
4141
This improves the developer experience by reducing bloat and cognitive load.
4242

43+
### System props
44+
45+
MUI System props (such as `mt={*}`, `bgcolor={*}`, and more) have been deprecated in the Box, Typography, Link, Grid, and Stack components.
46+
Use the codemod below to move all System props to the `sx` prop:
47+
48+
```bash
49+
npx @mui/codemod@next v6.0.0/system-props <path/to/folder>
50+
```
51+
52+
You can also manually update your components as shown in the snippet below:
53+
54+
```diff
55+
-<Button mr={2}>
56+
+<Button sx={{ mr: 2 }}>
57+
```
58+
59+
### Theme component variants
60+
61+
Custom component variants defined in the theme are now merged with the theme style overrides, defined within the `root` slot of the component.
62+
63+
Use this codemod to update your project's theme file:
64+
65+
```bash
66+
npx @mui/codemod@next v6.0.0/theme-v6 <path/to/theme>
67+
```
68+
69+
You can also manually update your theme as shown in the snippet below:
70+
71+
```diff
72+
createTheme({
73+
components: {
74+
MuiButton: {
75+
- variants: [ ... ],
76+
+ styleOverrides: {
77+
+ root: {
78+
+ variants: [ ... ],
79+
+ },
80+
+ },
81+
},
82+
},
83+
});
84+
```
85+
86+
This reduces the API surface and lets you define variants in other slots of the component.
87+
4388
## AccordionSummary
4489

4590
Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#accordion-summary-classes) below to migrate the code as described in the following sections:

docs/data/material/migration/migration-grid-v2/migration-grid-v2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The Grid v2 is marked as stable in Material UI v6, so the `Unstable_` prefix is
8080
```
8181

8282
Alongside the stabilization, the API has been improved.
83-
You can see the changes and further details on how to migrate in the [Material UI v6 migration guide](/material-ui/migration/migrating-to-v6/).
83+
You can see the changes and further details on how to migrate in the [Material UI v6 upgrade guide](/material-ui/migration/upgrade-to-v6/).
8484

8585
Finally, the original Grid component is deprecated and will be removed in the future, so we highly encourage you to migrate to Grid v2.
8686

docs/data/material/migration/migrating-to-v6/migrating-to-pigment-css.md renamed to docs/data/material/migration/upgrade-to-v6/migrating-to-pigment-css.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<p class="description">This guide helps you integrate Pigment CSS with Material UI v6.</p>
44

5-
Before going through this guide, make sure you have [migrated to Material UI v6](/material-ui/migration/migrating-to-v6/).
5+
Before going through this guide, make sure you have [upgraded to Material UI v6](/material-ui/migration/upgrade-to-v6/).
66

77
## Introduction
88

0 commit comments

Comments
 (0)