muiv7
1. Executive Summary πβ
The upgrade from MUI v6 to v7 is a significant modernization step. Unlike the massive architectural shift from v4 to v5 (which introduced sx prop), the v6 to v7 migration is more focused on API cleanup, performance, and embracing modern CSS features.
The most impactful changes for developers are:
- Removal of Deprecated APIs: Functions and props deprecated in v5 are now completely removed.
 - Promotion of 
@mui/labComponents: Many components have graduated from the lab to the core@mui/materiallibrary, requiring import path updates. - Modern CSS Integration: MUI v7 introduces opt-in support for native CSS variables and CSS Layers, enabling modern color spaces and improving compatibility with other styling solutions.
 GridComponent Overhaul: The default<Grid>is now the more powerfulGridV2. The old implementation is still available as<GridLegacy>.
This migration is manageable but requires careful code review, especially regarding imports and theme configuration.
- From:
@mui/icons-material:^6.1.8@mui/lab:6.0.1-beta.36@mui/material:^6.1.8@mui/system:^6.1.8
 - To:
@mui/icons-material:^7.3.1@mui/lab:7.0.0-beta.16@mui/material:^7.3.1@mui/system:^7.3.1
 
2. Critical Breaking Changes β οΈβ
These are changes that will likely break your application and require immediate attention.
a. No More Deep Importsβ
Directly importing modules from deep paths is no longer supported. This was done to improve ESM support and tree-shaking.
- 
Before (β Invalid in v7):
import Button from '@mui/material/Button';
import { deepmerge } from '@mui/utils'; - 
After (β Correct in v7):
import { Button } from '@mui/material';
import { deepmerge } from '@mui/utils'; // No change for @mui/utils rootAction Required: Update all component and utility imports to use the top-level package entry point. MUI provides a codemod to help automate this:
npx @mui/codemod v7.0.0/top-level-imports <path>. 
b. Removal of createMuiThemeβ
The createMuiTheme function, which was an alias for createTheme since v5, has been removed.
- 
Before (β Invalid in v7):
import { createMuiTheme } from '@mui/material/styles';
const theme = createMuiTheme({...}); - 
After (β Correct in v7):
import { createTheme } from '@mui/material/styles';
const theme = createTheme({...}); 
c. Grid is Now GridV2β
The default export for the Grid component is now the improved GridV2, which uses CSS variables and offers more flexibility. The old Grid is available for a smoother transition but is considered legacy.
- 
If you import from Grid in GESSO, itβs still using the old Grid. Itβs deprecated and will be migrated in a later version.
 - 
To keep the old Grid behavior temporarily:
// import from Gesso
import { Grid, GridItem } from '@acromedia/gesso'// import from mui
import { Unstable_Grid2 as Grid } from '@mui/material'; // In v6
// In v7, if you still need the old one:
import GridLegacy from '@mui/material/Grid';// classname changes
'& .MuiGrid-item': { // In v6
...
}
'& .MuiGridLegacy-item': { // In v7
...
}
'& .MuiGrid-grid-xs-12': { // In v6
...
}
'& .MuiGridLegacy-grid-xs-12': { // In v7
...
} - 
To adopt the new Grid:
import Grid from '@mui/material/Grid'; // This is now GridV2 by default 
d. Theme Palette Mode Changeβ
The theme.palette.mode will now return the actual mode of the theme ('light' or 'dark'), not what was passed to createTheme. This makes it more reliable in themes that derive from other themes. This is a subtle but important change for any logic that depends on the initial theme configuration.
e. TypeScript: Theme Augmentationβ
If you are using TypeScript and augmenting the theme, the module path has changed.
- 
Before (β Invalid in v7):
declare module '@mui/material/styles/createTheme' {
interface Theme {...}
} - 
After (β Correct in v7):
declare module '@mui/material/styles' {
interface Theme {...}
} 
3. Major New Features & Architectural Shifts β¨β
a. Native Color Support with CSS Variablesβ
This is the flagship feature of v7. You can now opt into using a CssVarsProvider which leverages native CSS variables for the color palette.
Benefits:
- 
Supports modern color spaces (
P3,LCH,LAB). - 
Avoids the need to re-declare the entire theme in JavaScript for dark mode.
 - 
Enables easier integration with other CSS-variable-based libraries.
 - 
How to implement:
import { Experimental_CssVarsProvider as CssVarsProvider } from '@mui/material/styles';
import theme from './theme';
function App() {
return (
<CssVarsProvider theme={theme}>
{/* Your app components */}
</CssVarsProvider>
);
} 
b. CSS Layers Supportβ
To prevent style specificity conflicts with other libraries (like Tailwind CSS or vanilla CSS), you can now enable CSS Layers. This wraps MUI's styles in a CSS @layer, giving you more control over the cascade.
- How to implement:
import { createTheme, ThemeProvider } from '@mui/material/styles';
const theme = createTheme({
cssLayers: true,
});
function App() {
return (
<ThemeProvider theme={theme}>
{/* Your app components */}
</ThemeProvider>
);
} 
4. @mui/lab Component Graduation πβ
A significant number of components have been stabilized and moved from @mui/lab to @mui/material or other dedicated packages like @mui/x-date-pickers. You must update the import paths for these components.
| Component | Old Path (@mui/lab) | New Path (@mui/material) | 
|---|---|---|
LoadingButton | @mui/lab/LoadingButton | @mui/material/LoadingButton | 
Masonry | @mui/lab/Masonry | @mui/material/Masonry | 
Timeline | @mui/lab/Timeline | @mui/material/Timeline | 
TimelineConnector | @mui/lab/TimelineConnector | @mui/material/TimelineConnector | 
TimelineContent | @mui/lab/TimelineContent | @mui/material/TimelineContent | 
TimelineDot | @mui/lab/TimelineDot | @mui/material/TimelineDot | 
TimelineItem | @mui/lab/TimelineItem | @mui/material/TimelineItem | 
TimelineOppositeContent | @mui/lab/TimelineOppositeContent | @mui/material/TimelineOppositeContent | 
TimelineSeparator | @mui/lab/TimelineSeparator | @mui/material/TimelineSeparator | 
TrapFocus | @mui/lab/TrapFocus | @mui/material/Unstable_TrapFocus (note: still unstable) | 
TreeItem | @mui/lab/TreeItem | @mui/x-tree-view/TreeItem | 
TreeView | @mui/lab/TreeView | @mui/x-tree-view/TreeView | 
Action Required: Search your codebase for imports from @mui/lab and update them to their new, stable locations. You will likely need to add @mui/x-tree-view as a new dependency if you use TreeView.
5. Recommended Migration Steps πβ
- 
Update Dependencies: Update your
package.jsonto the target v7 versions.npm install @mui/material@latest @mui/icons-material@latest @mui/lab@latest @emotion/react@latest @emotion/styled@latest - 
Run Codemods: Use the official MUI codemods to automate as much of the process as possible, especially for updating imports.
npx @mui/codemod v7.0.0/top-level-imports <your-source-path> - 
Update Theme Creation: Manually change all instances of
createMuiThemetocreateTheme. - 
Update Component Imports: Manually find and update all imports for components that graduated from
@mui/lab. - 
Review Grid Usage: Audit every usage of the
<Grid>component. Decide whether to migrate to the new API immediately or use<GridLegacy>as a temporary solution. - 
Check for Other Removed APIs: Search for other APIs that were deprecated in v5 and are now removed, such as
darkScrollbarfrom@mui/material. - 
Test Thoroughly: After making these changes, perform a comprehensive test of your application's UI and functionality. Pay close attention to layout, theming, and any custom component styling.
 - 
Consider New Features: Once your app is stable on v7, consider adopting the new
CssVarsProviderfor improved color handling andcssLayersif you have style conflicts. 
6. Official Resourcesβ
- Official Migration Guide: Upgrade to v7 - Material UI
 - v7 Release Blog Post: Material UI v7 is here!
 - MUI GitHub Releases: MUI Releases on GitHub