-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[material-ui][docs] Add Material 3 components page (#40350)
- Loading branch information
1 parent
d0b44b0
commit 8ac8a6d
Showing
23 changed files
with
342 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
docs/data/material/guides/material-3-components/MD3AndV5Usage.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import * as React from 'react'; | ||
import MD2Button from '@mui/material/Button'; | ||
import { ThemeProvider, createTheme } from '@mui/material/styles'; | ||
import MD3Button from '@mui/material-next/Button'; | ||
import { CssVarsProvider, extendTheme } from '@mui/material-next/styles'; | ||
import { Stack } from '@mui/system'; | ||
|
||
const md2Theme = createTheme(); | ||
const md3Theme = extendTheme(); | ||
|
||
export default function MD3AndV5Usage() { | ||
return ( | ||
<ThemeProvider theme={md2Theme}> | ||
<Stack spacing={2} direction="row"> | ||
<MD2Button variant="contained">MD2 Button</MD2Button> | ||
<CssVarsProvider theme={md3Theme}> | ||
<MD3Button variant="filled">MD3 Button</MD3Button> | ||
</CssVarsProvider> | ||
</Stack> | ||
</ThemeProvider> | ||
); | ||
} |
22 changes: 22 additions & 0 deletions
22
docs/data/material/guides/material-3-components/MD3AndV5Usage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import * as React from 'react'; | ||
import MD2Button from '@mui/material/Button'; | ||
import { ThemeProvider, createTheme } from '@mui/material/styles'; | ||
import MD3Button from '@mui/material-next/Button'; | ||
import { CssVarsProvider, extendTheme } from '@mui/material-next/styles'; | ||
import { Stack } from '@mui/system'; | ||
|
||
const md2Theme = createTheme(); | ||
const md3Theme = extendTheme(); | ||
|
||
export default function MD3AndV5Usage() { | ||
return ( | ||
<ThemeProvider theme={md2Theme}> | ||
<Stack spacing={2} direction="row"> | ||
<MD2Button variant="contained">MD2 Button</MD2Button> | ||
<CssVarsProvider theme={md3Theme}> | ||
<MD3Button variant="filled">MD3 Button</MD3Button> | ||
</CssVarsProvider> | ||
</Stack> | ||
</ThemeProvider> | ||
); | ||
} |
8 changes: 8 additions & 0 deletions
8
docs/data/material/guides/material-3-components/MD3AndV5Usage.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<ThemeProvider theme={md2Theme}> | ||
<Stack spacing={2} direction="row"> | ||
<MD2Button variant="contained">MD2 Button</MD2Button> | ||
<CssVarsProvider theme={md3Theme}> | ||
<MD3Button variant="filled">MD3 Button</MD3Button> | ||
</CssVarsProvider> | ||
</Stack> | ||
</ThemeProvider> |
11 changes: 11 additions & 0 deletions
11
docs/data/material/guides/material-3-components/MD3ButtonUsage.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as React from 'react'; | ||
import Button from '@mui/material-next/Button'; | ||
import { CssVarsProvider } from '@mui/material-next/styles'; | ||
|
||
export default function MD3ButtonUsage() { | ||
return ( | ||
<CssVarsProvider> | ||
<Button variant="filled">Button</Button> | ||
</CssVarsProvider> | ||
); | ||
} |
11 changes: 11 additions & 0 deletions
11
docs/data/material/guides/material-3-components/MD3ButtonUsage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as React from 'react'; | ||
import Button from '@mui/material-next/Button'; | ||
import { CssVarsProvider } from '@mui/material-next/styles'; | ||
|
||
export default function MD3ButtonUsage() { | ||
return ( | ||
<CssVarsProvider> | ||
<Button variant="filled">Button</Button> | ||
</CssVarsProvider> | ||
); | ||
} |
3 changes: 3 additions & 0 deletions
3
docs/data/material/guides/material-3-components/MD3ButtonUsage.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<CssVarsProvider> | ||
<Button variant="filled">Button</Button> | ||
</CssVarsProvider> |
38 changes: 38 additions & 0 deletions
38
docs/data/material/guides/material-3-components/MD3Theming.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import * as React from 'react'; | ||
import Button from '@mui/material-next/Button'; | ||
import { extendTheme, CssVarsProvider } from '@mui/material-next/styles'; | ||
|
||
const customTheme = extendTheme({ | ||
ref: { | ||
palette: { | ||
primary: { | ||
0: '#000000', | ||
10: '#002020', | ||
20: '#003738', | ||
30: '#004F51', | ||
40: '#00696B', | ||
50: '#008587', | ||
60: '#00A1A3', | ||
70: '#00BEC1', | ||
80: '#2DDBDE', | ||
90: '#8FF3F4', | ||
95: '#B2FEFF', | ||
99: '#F1FFFF', | ||
100: '#FFFFFF', | ||
}, | ||
}, | ||
}, | ||
// cssVarPrefix is only required if multiple themes coexist | ||
// on the same page like on this guide | ||
cssVarPrefix: 'turquoise-md3', | ||
}); | ||
|
||
export default function MD3Theming() { | ||
return ( | ||
<CssVarsProvider theme={customTheme}> | ||
<Button color="primary" variant="filled"> | ||
Button | ||
</Button> | ||
</CssVarsProvider> | ||
); | ||
} |
38 changes: 38 additions & 0 deletions
38
docs/data/material/guides/material-3-components/MD3Theming.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import * as React from 'react'; | ||
import Button from '@mui/material-next/Button'; | ||
import { extendTheme, CssVarsProvider } from '@mui/material-next/styles'; | ||
|
||
const customTheme = extendTheme({ | ||
ref: { | ||
palette: { | ||
primary: { | ||
0: '#000000', | ||
10: '#002020', | ||
20: '#003738', | ||
30: '#004F51', | ||
40: '#00696B', | ||
50: '#008587', | ||
60: '#00A1A3', | ||
70: '#00BEC1', | ||
80: '#2DDBDE', | ||
90: '#8FF3F4', | ||
95: '#B2FEFF', | ||
99: '#F1FFFF', | ||
100: '#FFFFFF', | ||
}, | ||
}, | ||
}, | ||
// cssVarPrefix is only required if multiple themes coexist | ||
// on the same page like on this guide | ||
cssVarPrefix: 'turquoise-md3', | ||
}); | ||
|
||
export default function MD3Theming() { | ||
return ( | ||
<CssVarsProvider theme={customTheme}> | ||
<Button color="primary" variant="filled"> | ||
Button | ||
</Button> | ||
</CssVarsProvider> | ||
); | ||
} |
5 changes: 5 additions & 0 deletions
5
docs/data/material/guides/material-3-components/MD3Theming.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<CssVarsProvider theme={customTheme}> | ||
<Button color="primary" variant="filled"> | ||
Button | ||
</Button> | ||
</CssVarsProvider> |
Oops, something went wrong.