-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Changes from 2 commits
50d8914
183e408
952257e
cd6016b
3ff9034
9581893
a5ac829
3dd0cbb
08e7663
d3aaa1b
e9c21a5
922515c
76b7e4b
cfbc50e
ed2a05a
29f4059
62d3844
9f76644
00c7cde
e2be118
4c89650
65d1216
73ae9b1
cd9fc22
364c529
e895ac7
362ba80
ab81b0d
9f53d7d
3d7949d
f23729d
967269b
dc4577c
b91cd3f
dbd7b87
14a47e2
c9b77db
cd232df
bba0f2c
e6decb0
7ee12a2
8e93b1f
7a0e090
e92f2ef
d293ec5
9a4bb11
8f80653
1b50e56
24447b3
38786e2
22e2c80
2a5d8c5
5fb7bb3
3f4e41c
48ae6b9
d203ae6
61bd3df
1279f8e
d2b7521
b76959c
9b58d64
bc4ff77
9a699e3
3db6fd4
684ac0f
6446b1e
8a320e9
9cf4e91
27f8f14
625bed0
788e2a4
249b13a
a29c08a
9ef3f8c
f1f875a
9dd9368
026fda2
bee0c28
1fa656e
dc84a82
7113417
df4bb72
b61a4ce
7f6557c
e2faf7c
00af68b
1482472
0a50f54
1688473
58bb5c0
4b80fe4
90e5ef9
f755a13
7439d33
f3d957e
e60a5d2
789aae6
43d80ed
9cea96d
eff3f15
73bf67b
72ab8ae
77ac964
dff4008
2da1163
437a576
28779bc
2b40a34
32bdd84
589086f
60ac247
43c274d
eb7e851
c61370f
5b916c9
2762dc6
affbec3
0102479
810c7fb
034f7ec
031257b
d72b9f8
244d316
eddbe94
f7465f2
11054fe
506d4d6
72050f8
553298b
4ab606b
6190a89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 } from './material-ui-v6-sneak-peek.md?muiMarkdown'; | ||
|
||
export default function Page() { | ||
return <TopLayoutBlog docs={docs} />; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
--- | ||
title: Material UI v6 Sneak Peek | ||
description: Previewing all the major updates of Material UI v6. | ||
date: 2024-04-17T00:00:00.000Z | ||
authors: ['siriwatknp'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure which is the standard, but per this comment I guess we are missing some people here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I will add everyone involved in v6. |
||
tags: ['Material UI', 'Product'] | ||
manualCard: true | ||
--- | ||
|
||
Material UI v6 is coming soon! We're excited to share a sneak peek of all the major updates. | ||
Check failure on line 10 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 10 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check failure on line 10 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 10 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
|
||
|
||
## Opt-in CSS extraction via Pigment CSS | ||
|
||
As you know, Material UI v5 is using 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. | ||
Check failure on line 14 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check failure on line 14 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
|
||
siriwatknp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
In the upcoming v6, we're introducing an opt-in integration with Pigment CSS, our new open-source library, that will eliminate the overhead of style recalculation while preserving similar APIs that you are already familiar with. | ||
Check warning on line 16 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check failure on line 16 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 16 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 16 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 16 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check failure on line 16 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 16 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 16 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
|
||
|
||
Since the integration is an opt-in feature, you can upgrade to v6 and continue using Emotion if you'd like. We will provide a migration guide to help you switch to Pigment CSS at your pace. | ||
Check warning on line 18 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 18 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check failure on line 18 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 18 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 18 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check failure on line 18 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
|
||
siriwatknp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<!-- would be nice if we have a link to a prototype page --> | ||
|
||
## Theming | ||
|
||
### New API for dark mode | ||
|
||
The new API `theme.applyStyles()` has been added to unify all supporting styling solutions, including Emotion, Styled-components and Pigment CSS. | ||
Check failure on line 26 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check failure on line 26 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
|
||
|
||
```diff | ||
const StyledInput = styled(InputBase)(({ theme }) => ({ | ||
padding: 10, | ||
width: '100%', | ||
- borderBottom: `1px solid ${ | ||
- theme.palette.mode === 'dark' ? '#30363d' : '#eaecef' | ||
- }`, | ||
+ borderBottom: `1px solid #eaecef`, | ||
+ ...theme.applyStyles('dark', { | ||
+ borderBottom: '1px solid #30363d', | ||
+ }) | ||
'& input': { | ||
borderRadius: 4, | ||
- backgroundColor: '#fff', | ||
+ ...theme.applyStyles('dark', { | ||
+ backgroundColor: '#0d1117', | ||
+ }) | ||
}, | ||
})); | ||
``` | ||
|
||
We are working on a codemod to help you migrate your existing codebase to this new API. | ||
Check warning on line 49 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 49 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
|
||
|
||
### Container Queries | ||
|
||
We added support for [container queries](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries) based on the existing `theme.breakpoints` API. | ||
Check warning on line 53 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 53 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
|
||
|
||
This feature lets you define styles based on the width of the parent container instead of the viewport. | ||
siriwatknp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```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')]: { | ||
flexDirection: 'row', | ||
}, | ||
})); | ||
``` | ||
|
||
It also works with the `sx` prop: | ||
|
||
```jsx | ||
<Card | ||
sx={{ | ||
'@sm': { | ||
flexDirection: 'row', | ||
}, | ||
'@400/sidebar': { | ||
flexDirection: 'row', | ||
}, | ||
}} | ||
/> | ||
``` | ||
|
||
## Stablizing CSS Theme Variables | ||
|
||
We introduced [CSS theme variables](https://mui.com/material-ui/experimental-api/css-theme-variables/overview/) in v5 as an experimental API. In v6, we are making it a stable API with two more additions: | ||
Check warning on line 88 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 88 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 88 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
Check warning on line 88 in docs/pages/blog/material-ui-v6-sneak-peek.md GitHub Actions / runner / vale
|
||
|
||
### Spacing | ||
|
||
The value from `theme.spacing()` will use the CSS variable `--mui-spacing` under the hood including `sx` values. | ||
|
||
```jsx | ||
<Button | ||
sx={(theme) => ({ | ||
padding: theme.spacing(2), // calc(var(--mui-spacing) * 2) | ||
})} | ||
/> | ||
``` | ||
|
||
### Typography | ||
|
||
The typography tokens will be generated as CSS variables for using with CSS `font` property. | ||
|
||
You can access the typography tokens from `theme.vars.typography.*`: | ||
|
||
```jsx | ||
const Title = styled('div')(({ theme }) => ({ | ||
font: theme.vars.typography.h1, | ||
siriwatknp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
})); | ||
``` | ||
|
||
or refer to the CSS variable directly: | ||
|
||
```css | ||
.some-component { | ||
font: var(--mui-typography-h1); | ||
siriwatknp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
``` | ||
|
||
## Revamping the free templates | ||
siriwatknp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
We are upgrading the [free templates](https://mui.com/material-ui/getting-started/templates/) to make them look amazing for your next project. Here are some sneak peeks: | ||
|
||
<!-- Add images --> | ||
|
||
## Deprecations | ||
|
||
- Drop IE11 support | ||
- Deprecate `components` and `componentProps` props in favor of `slots` and `slotProps` through codemods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this change better communicates that v6 is close in time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to stable release. I will let @samuelsycamore casts his magic for the title.