Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[blog] Add Material UI v6 stable release #41932

Merged
merged 131 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 118 commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
50d8914
add blog page
siriwatknp Apr 17, 2024
183e408
add 'free'
siriwatknp Apr 17, 2024
952257e
Merge branch 'next' of https://github.com/mui/material-ui into blog/v…
siriwatknp Jun 28, 2024
cd6016b
refine content
siriwatknp Jul 1, 2024
3ff9034
Merge branch 'next' of https://github.com/mui/material-ui into blog/v…
siriwatknp Jul 1, 2024
9581893
add strategy to extendTheme
siriwatknp Jul 1, 2024
a5ac829
fix extendTheme
siriwatknp Jul 2, 2024
3dd0cbb
attach selector based on strategy
siriwatknp Jul 2, 2024
08e7663
remove attribute in favor of strategy
siriwatknp Jul 2, 2024
d3aaa1b
support class in InitColorSchemeScript
siriwatknp Jul 2, 2024
e9c21a5
Merge branch 'next' of https://github.com/mui/material-ui into refine…
siriwatknp Jul 2, 2024
922515c
use default config
siriwatknp Jul 2, 2024
76b7e4b
update docs
siriwatknp Jul 2, 2024
cfbc50e
Merge branch 'next' of https://github.com/mui/material-ui into refine…
siriwatknp Jul 3, 2024
ed2a05a
Merge branch 'next' of https://github.com/mui/material-ui into refine…
siriwatknp Jul 4, 2024
29f4059
update docs
siriwatknp Jul 4, 2024
62d3844
fix extendTheme
siriwatknp Jul 4, 2024
9f76644
fix InitColorSchemeScript
siriwatknp Jul 4, 2024
00c7cde
fix InitColorSchemeScript
siriwatknp Jul 4, 2024
e2be118
Merge branch 'next' of https://github.com/mui/material-ui into refine…
siriwatknp Jul 5, 2024
4c89650
fix applyStyles and add enableSystem
siriwatknp Jul 5, 2024
65d1216
add disableCssColorScheme option
siriwatknp Jul 5, 2024
73ae9b1
fix applyStyles and disableCssColorScheme
siriwatknp Jul 5, 2024
cd9fc22
fix default mode
siriwatknp Jul 5, 2024
364c529
add test
siriwatknp Jul 5, 2024
e895ac7
fix types
siriwatknp Jul 5, 2024
362ba80
export createPalette
siriwatknp Jul 5, 2024
ab81b0d
fix tests
siriwatknp Jul 5, 2024
9f53d7d
fix extendTheme
siriwatknp Jul 5, 2024
3d7949d
wip
siriwatknp Jul 5, 2024
f23729d
remove createPalette
siriwatknp Jul 6, 2024
967269b
update docs
siriwatknp Jul 6, 2024
dc4577c
fix Paper
siriwatknp Jul 8, 2024
b91cd3f
update docs
siriwatknp Jul 8, 2024
dbd7b87
Merge branch 'next' of https://github.com/mui/material-ui into refine…
siriwatknp Jul 8, 2024
14a47e2
remove colorSchemeSelector
siriwatknp Jul 8, 2024
c9b77db
remove defaultMode from CssVarsProvider
siriwatknp Jul 8, 2024
cd232df
run docs:ts format
siriwatknp Jul 8, 2024
bba0f2c
rename strategy to cssRule
siriwatknp Jul 8, 2024
e6decb0
Merge branch 'next' of https://github.com/mui/material-ui into refine…
siriwatknp Jul 8, 2024
7ee12a2
clean up classes
siriwatknp Jul 8, 2024
8e93b1f
fix lint
siriwatknp Jul 8, 2024
7a0e090
fix getColorSchemeSelector
siriwatknp Jul 8, 2024
e92f2ef
filter only valid color schemes
siriwatknp Jul 8, 2024
d293ec5
remove unused demos
siriwatknp Jul 8, 2024
9a4bb11
fix joy getColorSchemeSelector
siriwatknp Jul 8, 2024
8f80653
fix non breaking space
siriwatknp Jul 8, 2024
1b50e56
fix types
siriwatknp Jul 8, 2024
24447b3
disableCssColorScheme on Joy for now
siriwatknp Jul 8, 2024
38786e2
fix regression tests
siriwatknp Jul 8, 2024
22e2c80
add defaultGetSelector to prepareCssVars
siriwatknp Jul 8, 2024
2a5d8c5
fix demo
siriwatknp Jul 8, 2024
5fb7bb3
Apply suggestions from code review
siriwatknp Jul 10, 2024
3f4e41c
Merge branch 'next' of https://github.com/mui/material-ui into blog/v…
siriwatknp Jul 10, 2024
48ae6b9
rename blog and add peopel
siriwatknp Jul 10, 2024
d203ae6
add demo to templates
siriwatknp Jul 10, 2024
61bd3df
Merge branch 'next' of https://github.com/mui/material-ui into refine…
siriwatknp Jul 11, 2024
1279f8e
replace cssRule with colorSchemeSelector
siriwatknp Jul 11, 2024
d2b7521
replace cssRule with colorSchemeSelector
siriwatknp Jul 11, 2024
b76959c
remove enableSystem
siriwatknp Jul 11, 2024
9b58d64
fix extendTheme
siriwatknp Jul 11, 2024
bc4ff77
remove `defaultMode`
siriwatknp Jul 11, 2024
9a699e3
update docs
siriwatknp Jul 11, 2024
3db6fd4
fix regression
siriwatknp Jul 11, 2024
684ac0f
remove enableSystem
siriwatknp Jul 11, 2024
6446b1e
fix Joy tutorial
siriwatknp Jul 11, 2024
8a320e9
remove defaultColorScheme from CssVarsProvider props
siriwatknp Jul 11, 2024
9cf4e91
support 'class' and 'data' selector
siriwatknp Jul 11, 2024
27f8f14
update content
siriwatknp Jul 11, 2024
625bed0
trigger build
siriwatknp Jul 12, 2024
788e2a4
Merge branch 'next' of https://github.com/mui/material-ui into refine…
siriwatknp Jul 12, 2024
249b13a
fix all
siriwatknp Jul 12, 2024
a29c08a
minor fix joy docs
siriwatknp Jul 12, 2024
9ef3f8c
Merge branch 'next' of https://github.com/mui/material-ui into blog/v…
siriwatknp Jul 16, 2024
f1f875a
add theme tokens
siriwatknp Jul 16, 2024
9dd9368
Merge branch 'refine-dark-mode-api' into blog/v6-sneak-peek
siriwatknp Jul 16, 2024
026fda2
add ThemeTokens
siriwatknp Jul 16, 2024
bee0c28
add pricing and mobile images
siriwatknp Jul 17, 2024
1fa656e
Merge branch 'next' of https://github.com/mui/material-ui into blog/v…
siriwatknp Jul 17, 2024
dc84a82
Merge branch 'next' of https://github.com/mui/material-ui into blog/v…
siriwatknp Aug 1, 2024
7113417
revert change screenshots
siriwatknp Aug 1, 2024
df4bb72
revert conflict
siriwatknp Aug 1, 2024
b61a4ce
update post
siriwatknp Aug 1, 2024
7f6557c
update blog
siriwatknp Aug 2, 2024
e2faf7c
Refine template images
zanivan Aug 2, 2024
00af68b
Stray design tweaks to demos
zanivan Aug 2, 2024
1482472
Visual tweaks to CSS variables table
zanivan Aug 2, 2024
0a50f54
Fine tune table background
zanivan Aug 2, 2024
1688473
Merge branch 'next' of https://github.com/mui/material-ui into blog/v…
siriwatknp Aug 9, 2024
58bb5c0
fix non-breaking space
siriwatknp Aug 9, 2024
4b80fe4
use --mui prefix
siriwatknp Aug 9, 2024
90e5ef9
add links
siriwatknp Aug 9, 2024
f755a13
minor fixes
siriwatknp Aug 9, 2024
7439d33
fix non-breaking space
siriwatknp Aug 9, 2024
f3d957e
stretch theme tokens
siriwatknp Aug 9, 2024
e60a5d2
add stablized grid v2 content
siriwatknp Aug 12, 2024
789aae6
mention-toolpad-core
prakhargupta1 Aug 14, 2024
43d80ed
Bharat's review
prakhargupta1 Aug 14, 2024
9cea96d
Apply suggestions from code review
DiegoAndai Aug 14, 2024
eff3f15
Move toolpad section up to h2
DiegoAndai Aug 14, 2024
73bf67b
Add bundle size improvements explanation
DiegoAndai Aug 14, 2024
72ab8ae
Non-breaking space
DiegoAndai Aug 14, 2024
77ac964
Reorder sections
DiegoAndai Aug 14, 2024
dff4008
Update template images
zanivan Aug 15, 2024
2da1163
Merge branch 'next' of https://github.com/mui/material-ui into blog/v…
siriwatknp Aug 16, 2024
437a576
fix link
siriwatknp Aug 16, 2024
28779bc
update the content
siriwatknp Aug 19, 2024
2b40a34
apply suggestions
siriwatknp Aug 19, 2024
32bdd84
fix lint
siriwatknp Aug 19, 2024
589086f
fix spacing
siriwatknp Aug 19, 2024
60ac247
add optimized runtime performance and romgrk to the authors
siriwatknp Aug 19, 2024
43c274d
Add React 19 support section
aarongarciah Aug 19, 2024
eb7e851
fix scrollbar
siriwatknp Aug 19, 2024
c61370f
Add note about React 19 support in v5
aarongarciah Aug 20, 2024
5b916c9
update with the real number
siriwatknp Aug 20, 2024
2762dc6
Remove hard tabs
aarongarciah Aug 20, 2024
affbec3
remove numbers
siriwatknp Aug 20, 2024
0102479
Use non-breaking space
aarongarciah Aug 20, 2024
810c7fb
Apply suggestions from code review
siriwatknp Aug 21, 2024
034f7ec
summarize
siriwatknp Aug 21, 2024
031257b
fix summary
siriwatknp Aug 21, 2024
d72b9f8
Merge branch 'next' of https://github.com/mui/material-ui into blog/v…
siriwatknp Aug 21, 2024
244d316
fix non-breaking space
siriwatknp Aug 21, 2024
eddbe94
Update docs/pages/blog/material-ui-v6-is-out.md
siriwatknp Aug 21, 2024
f7465f2
Update docs/pages/blog/material-ui-v6-is-out.md
siriwatknp Aug 22, 2024
11054fe
Update docs/pages/blog/material-ui-v6-is-out.md
siriwatknp Aug 22, 2024
506d4d6
Merge branch 'next' of https://github.com/mui/material-ui into blog/v…
siriwatknp Aug 22, 2024
72050f8
Update blog date
DiegoAndai Aug 22, 2024
553298b
Add 10 years since initial commit callout
DiegoAndai Aug 22, 2024
4ab606b
add long dash
alelthomas Aug 22, 2024
6190a89
prettier
DiegoAndai Aug 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/pages/blog/material-ui-v6-is-out.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as React from 'react';
import TopLayoutBlog from 'docs/src/modules/components/TopLayoutBlog';
import { docs, srcComponents } from './material-ui-v6-is-out.md?muiMarkdown';

export default function Page() {
return <TopLayoutBlog docs={docs} srcComponents={srcComponents} />;
}
387 changes: 387 additions & 0 deletions docs/pages/blog/material-ui-v6-is-out.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,387 @@
---
title: Material UI v6 is out 🎉
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
description: We are so excited to announce the stable release of Material UI v6. It comes with Pigment CSS integration and a lot of improvements.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
date: 2024-08-09T00:00:00.000Z
DiegoAndai marked this conversation as resolved.
Show resolved Hide resolved
authors:
[
'aarongarciah',
'brijeshb42',
'diegoandai',
'mnajdova',
'romgrk',
'samuelsycamore',
'siriwatknp',
'zanivan',
]
tags: ['Material UI', 'Product']
manualCard: true
---

Material UI v6 is now stable! We're excited to share all the updates.

Check warning on line 20 in docs/pages/blog/material-ui-v6-is-out.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'We'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'We'.", "location": {"path": "docs/pages/blog/material-ui-v6-is-out.md", "range": {"start": {"line": 20, "column": 31}}}, "severity": "WARNING"}
aarongarciah marked this conversation as resolved.
Show resolved Hide resolved
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
## Table of contents

- [New features](#new-features)
- [CSS theme variables](#css-theme-variables)
- [Color schemes](#color-schemes)
- [CSS media `prefers-color-scheme`](#css-media-prefers-color-scheme)
- [Container Queries](#container-queries)
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
- [New method of applying styles](#new-method-of-applying-styles)
- [Improvements](#improvements)
- [Optimized runtime performance](#optimized-runtime-performance)
- [Revamping the free templates](#revamping-the-free-templates)
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
- [Stabilized Grid v2](#stabilized-grid-v2)
- [Package size reduction](#package-size-reduction)
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
- [Experimental CSS extraction via Pigment CSS](#experimental-css-extraction-via-pigmentcss)
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
- [React Server Components](#react-server-components)
- [Built-in sx prop support](#built-in-sx-prop-support)
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
- [React 19 support](#react-19-support)
- [Full-stack apps](#full-stack-apps)
prakhargupta1 marked this conversation as resolved.
Show resolved Hide resolved
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
- [What's next](#whats-next)

## New features

### CSS theme variables

CSS Variables has become an industry standard for the web.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
Material UI v6 introduces a new `cssVariables` flag that generates CSS variables from the serializable theme values like palette, spacing, typography, etc..
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

```js
const theme = createTheme({ cssVariables: true, ... });
```

{{"component": "components/blog/material-ui-v6-is-out/ThemeTokens.js"}}
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

After enabling the flag, you can access the variables from `theme.vars` object with the same structure as the theme.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

<codeblock>

```js JSX
const CustomComponent = styled('div')(({ theme }) => ({
backgroundColor: theme.vars.palette.background.default,
color: theme.vars.palette.text.primary,
}));
```

```css CSS
.CustomComponent-ae73f {
background-color: var(--mui-palette-background-default);
color: var(--mui-palette-text-primary);
}
```

</codeblock>

#### Benefits

- Improved developer experience—you can see where the values are coming from in the browser's dev tools.
- A starting point to fix the dark mode SSR flickering issue.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
- CSS variables open many doors for integration, for example, you can use Material UI theme in a plain CSS file.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

```css title="styles.css"
.custom-card {
background-color: var(--mui-palette-background-default);
color: var(--mui-palette-text-primary);
padding: var(--mui-spacing-2);
font: var(--mui-font-body1);
}
```

### Color schemes

In the previous version, if you want to support light and dark modes, you will have to create two separate themes and handle the logics to switch between modes. This can be complex and error-prone.

Check warning on line 92 in docs/pages/blog/material-ui-v6-is-out.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Will] Avoid using 'will'. Raw Output: {"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/pages/blog/material-ui-v6-is-out.md", "range": {"start": {"line": 92, "column": 75}}}, "severity": "WARNING"}
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

But not anymore! The new `colorSchemes` node is here to simplify the process.
With just one line of code, your application will support both light and dark modes instantly.

Check warning on line 95 in docs/pages/blog/material-ui-v6-is-out.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Will] Avoid using 'will'. Raw Output: {"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/pages/blog/material-ui-v6-is-out.md", "range": {"start": {"line": 95, "column": 46}}}, "severity": "WARNING"}
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

```js
const theme = createTheme({ colorSchemes: { dark: true } });
// light is generated by default.

function App() {
return <ThemeProvider theme={theme}>...</ThemeProvider>;
}
```

When color schemes are used, Material UI ships these features out of the box:
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

- System preference detection.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
- You can achieve instant transitions between modes with the `disableTransitionOnChange` prop.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
- The selected mode is stored in local storage to persist the user's preference.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
- The selected mode is automatically synced between browser tabs.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

#### A hook for toggling between modes

The new `useColorScheme` hook lets you read and update the mode in your application.

```jsx
import { useColorScheme } from '@mui/material/styles';

function ModeSwitcher() {
const { mode, setMode } = useColorScheme();
if (!mode) return null;
return (
<select onChange={(event) => setMode(event.target.mode)}>
<option value="system">System</option>
<option value="light">Light</option>
<option value="dark">Dark</option>
</select>
);
}
```

### CSS media `prefers-color-scheme`

When [CSS variables](#css-theme-variables) and [color schemes](#color-schemes) are enabled, Material UI uses `prefers-color-scheme` media query is the default method for generating CSS variables.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

<codeblock>

```js JSX
import { createTheme, ThemeProvider } from '@mui/material/styles';

const theme = createTheme({
cssVariables: true,
colorSchemes: { dark: true },
});

function App() {
return <ThemeProvider theme={theme}>...</ThemeProvider>;
}
```

```css CSS
:root {
--mui-palette-primary-main: #1976d2;
--mui-palette-background-default: #fff;
...
}

@media (prefers-color-scheme: dark) {
:root {
--mui-palette-primary-main: #90caf9;
--mui-palette-background-default: #121212;
...
}
}
```

</codeblock>

### Container Queries
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

We've added a [container queries](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries) utility based on the existing `theme.breakpoints` API.

Check warning on line 172 in docs/pages/blog/material-ui-v6-is-out.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'We'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'We'.", "location": {"path": "docs/pages/blog/material-ui-v6-is-out.md", "range": {"start": {"line": 172, "column": 1}}}, "severity": "WARNING"}
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

This feature lets you define styles based on the parent container's width instead of the viewport.

<codeblock>

```jsx JSX
const Component = styled('div')(({ theme }) => ({
display: 'flex',
flexDirection: 'column',
gap: theme.spacing(2),
[theme.containerQueries.up('sm')]: {
flexDirection: 'row',
},
[theme.containerQueries('sidebar').up('400px')]: {
// @container sidebar (min-width: 400px)
flexDirection: 'row',
},
}));
```

```css CSS
/* Simplified CSS Output */

.Component-ad83f {
display: flex;
flex-direction: column;
gap: 16px;
@container (min-width: 600px) {
flex-direction: row;
}
@container sidebar (min-width: 400px) {
flex-direction: row;
}
}
```

</codeblock>

It also works with the `sx` prop:

<codeblock>

```jsx JSX
<Card
sx={{
'@sm': {
flexDirection: 'row',
},
'@400/sidebar': {
flexDirection: 'row',
},
}}
/>
```

```css CSS
/* Simplified CSS Output */

.MuiCard-root-dn383 {
@container (min-width: 600px) {
flex-direction: row;
}
@container sidebar (min-width: 400px) {
flex-direction: row;
}
}
```

</codeblock>

### New method of applying styles

The new API `theme.applyStyles` has been added for creating specific mode styles. It's designed to replace the `theme.palette.mode === 'dark'` condition to fix the SSR flickering issue when combined with CSS theme variables feature.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

<codeblock>

```jsx After
const StyledInput = styled(InputBase)(({ theme }) => ({
padding: 10,
width: '100%',
borderBottom: '1px solid #eaecef',
...theme.applyStyles('dark', {
borderBottom: '1px solid #30363d',
}),
'& input': {
borderRadius: 4,
backgroundColor: '#fff',
...theme.applyStyles('dark', {
backgroundColor: '#0d1117',
}),
},
}));
```

```jsx Before
const StyledInput = styled(InputBase)(({ theme }) => ({
padding: 10,
width: '100%',
borderBottom:
theme.palette.mode === 'dark' ? '1px solid #30363d' : '1px solid #eaecef',
'& input': {
borderRadius: 4,
backgroundColor: theme.palette.mode === 'dark' ? '#0d1117' : '#fff',
},
}));
```

</codeblock>

:::info
We provide a codemod to help you migrate from `theme.palette.mode === 'dark'` to `theme.applyStyles()`. You can find the link to the migration guide at the end of the blog post.

Check warning on line 283 in docs/pages/blog/material-ui-v6-is-out.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'We'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'We'.", "location": {"path": "docs/pages/blog/material-ui-v6-is-out.md", "range": {"start": {"line": 283, "column": 1}}}, "severity": "WARNING"}
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
:::

## Improvements

### Optimized runtime performance

[Several optimizations](https://github.com/mui/material-ui/pulls?q=is%3Apr+author%3Aromgrk+is%3Aclosed+perf+sort%3Aupdated-desc) have been made to improve the runtime performance of Material UI v6.

This is just the beginning of our performance improvements. There are more optimizations in our pipeline, so stay tuned for v6.x updates and the benchmark result!

Check warning on line 292 in docs/pages/blog/material-ui-v6-is-out.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'our'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'our'.", "location": {"path": "docs/pages/blog/material-ui-v6-is-out.md", "range": {"start": {"line": 292, "column": 31}}}, "severity": "WARNING"}

Check warning on line 292 in docs/pages/blog/material-ui-v6-is-out.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'our'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'our'.", "location": {"path": "docs/pages/blog/material-ui-v6-is-out.md", "range": {"start": {"line": 292, "column": 93}}}, "severity": "WARNING"}
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

### Revamping the free templates
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

Explore the new and enhanced [Material UI free templates](https://mui.com/material-ui/getting-started/templates/) to see these amazing features in action. We've fully revamped the templates to provide the perfect starting point for your project, whether you're adding sleek styles or using the template's sections.

Check warning on line 296 in docs/pages/blog/material-ui-v6-is-out.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'We'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'We'.", "location": {"path": "docs/pages/blog/material-ui-v6-is-out.md", "range": {"start": {"line": 296, "column": 156}}}, "severity": "WARNING"}
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

{{"component": "components/blog/material-ui-v6-is-out/FreeTemplatesBento.js"}}

#### Custom styles

The new custom styles we've added allow you to dive into the best approaches for customization or simply copy and paste some stylish elements.

Check warning on line 302 in docs/pages/blog/material-ui-v6-is-out.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'we'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'we'.", "location": {"path": "docs/pages/blog/material-ui-v6-is-out.md", "range": {"start": {"line": 302, "column": 23}}}, "severity": "WARNING"}
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

{{"component": "components/blog/material-ui-v6-is-out/CustomThemeComparison.js"}}

### Stabilized Grid v2

Grid v2 has been stabilized and is now using **CSS gap** for creating space between grid items.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
This is a huge improvement over the previous version, which used padding and margin to create space.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

The responsive configuration has been consolidated into `size` and `offset` props for consistency.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

```jsx
import Grid from '@mui/material/Grid2';

<Grid container>
<Grid size={{ xs: 6, sm: 4, lg: 3 }} />
<Grid size={{ xs: 6, sm: 4, lg: 3 }} />
<Grid size={{ xs: 6, sm: 4, lg: 3 }} />
</Grid>;
```

### Package size reduction
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

To align with React 19's removal of UMD builds, Material UI has also removed its UMD bundle.
This results in a reduction of the `@mui/material` package size by 2.5MB, or 25% of the total package size.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
See [Package Phobia](https://packagephobia.com/result?p=@mui/material) for more details.
Instead, we recommend using ESM-based CDNs such as [esm.sh](https://esm.sh/).

Check warning on line 328 in docs/pages/blog/material-ui-v6-is-out.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'we'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'we'.", "location": {"path": "docs/pages/blog/material-ui-v6-is-out.md", "range": {"start": {"line": 328, "column": 10}}}, "severity": "WARNING"}
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
For alternative installation methods, refer to the [CDN documentation](/material-ui/getting-started/installation/#cdn).

## Experimental CSS extraction via Pigment CSS

As you know, Material UI v5 uses Emotion as a default styling solution. As a runtime CSS-in-JS library, it has several trade-offs such as slower performance and larger bundle size.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

In v6, we introduce an opt-in integration with [Pigment CSS](https://github.com/mui/pigment-css), our new zero-runtime styling library, that will eliminate the runtime overhead while preserving similar APIs that you are already familiar with.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

:::warning
Pigment CSS integration is still in the experimental stage. We recommend testing it out with our examples ([Next.js](https://github.com/mui/material-ui/tree/master/examples/material-ui-pigment-css-nextjs-ts) or [Vite](https://github.com/mui/material-ui/tree/master/examples/material-ui-pigment-css-vite)) and providing feedbacks to help us improve the feature.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

Then, if you're ready to integrate Pigment CSS into your project, follow the migration guide at the bottom of the page
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
:::

### React Server Components

Once integrated with Pigment CSS, Material UI v6 provides a separate set of layout components, including `Grid`, `Container`, and `Stack`, that are compatible with React Server Components.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

```jsx
import Grid from '@mui/material-pigment-css/Grid';
import Container from '@mui/material-pigment-css/Container';
import Stack from '@mui/material-pigment-css/Stack';
```

### Built-in sx prop support

With Pigment CSS integration, all JSX elements support the `sx` prop out of the box.
The `Box` component is no longer required to use the `sx` prop.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

```diff
-import Box from '@mui/material/Box';

-<Box component="img" sx={{ padding: 2 }} />
+<img sx={{ padding: 2 }} />
```

## React 19 support

Material UI v6 is ready for React 19. We've been testing Material UI with the latest [React 19 RC](https://react.dev/blog/2024/04/25/react-19) versions to ensure compatibility once the stable release of React 19 is out.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

Also, we're working on backporting React 19 support to Material UI v5. Stay tuned.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

## Full-stack apps
Janpot marked this conversation as resolved.
Show resolved Hide resolved
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

To get started building full-stack apps fast, we're building [Toolpad Core](https://mui.com/toolpad/) - get Material UI, Next.js, routing, layout components and authentication out of the box while you build dashboards or internal tools.
prakhargupta1 marked this conversation as resolved.
Show resolved Hide resolved
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

Stay tuned, as many more updates are coming in the upcoming months! We'd love to hear your feedback on which templates or sections you'd like to see next.
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

## What's next
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

Ready to upgrade to Material UI v6? Check out the [v6 migration guide](/material-ui/migration/upgrade-to-v6/).
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

You can also explore all the updates in more detail from the links below:
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved

- [Pigment CSS integration](/material-ui/migration/migrating-to-pigment-css/)
- [Container Queries](/material-ui/customization/container-queries/)
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
- [CSS theme variables](/material-ui/customization/css-theme-variables/overview/)
- [Stabilized Grid v2](/material-ui/migration/upgrade-to-v6/#grid2)
- [Free templates](/material-ui/getting-started/templates/)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading