Upgrade to v7

This guide explains how to upgrade from Material UI v6 to v7.

Why you should upgrade to Material UI v7

Improved ESM support

The package layout has been updated, and now unambiguously supports both valid ESM and CommonJS through the exports field in package.json . You can read more about package exports in the Node.js documentation .

This update fixes several issues with popular bundlers like Vite and webpack, and makes it possible to load MUI packages from ES modules under Node.js.

Quality-of-life improvements

Material UI v7 features other quality-of-life improvements, including:

  • Standardization of the slot pattern across all components
  • CSS layers support via the enableCssLayer prop in StyledEngineProvider for client-side apps, and AppRouterCacheProvider for Next.js App Router apps
  • Removed deprecated APIs to reduce the API surface and make the docs easier to navigate
  • If you're using any of these packages, you should also update their versions to "7.0.0" :

  • @mui/icons-material
  • @mui/system
  • @mui/lab
  • @mui/material-nextjs
  • @mui/styled-engine
  • @mui/styled-engine-sc
  • @mui/utils
  • Note that MUI X packages do not follow the same versioning strategy as Material UI. If you're using any of the following packages, they should remain unchanged during the upgrade process:

  • @mui/x-data-grid
  • @mui/x-data-grid-pro
  • @mui/x-data-grid-premium
  • @mui/x-date-pickers
  • @mui/x-date-pickers-pro
  • @mui/x-charts
  • @mui/x-tree-view
  • @mui/x-tree-view-pro
  • Minimum TypeScript version

    The minimum supported version of TypeScript has been increased from v4.7 to 4.9.

    We align with support window by DefinitelyTyped (published on npm under the @types namespace).

    We will not change the minimum supported version in a minor version of Material UI. However, we recommend not using a TypeScript version older than the lowest supported version by DefinitelyTyped.

    For @types/react* packages, make sure they are the same major version as the react you are using. Use the snippet below to update your project if needed (replace the <version> with the major version of react you are using):

    npm install @types/react@<version> @types/react-dom@<version>