-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs][material-ui] Revise the Paper component docs (#38841)
Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
- Loading branch information
1 parent
95f30bb
commit e1cb35e
Showing
10 changed files
with
130 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import * as React from 'react'; | ||
import Stack from '@mui/material/Stack'; | ||
import Paper from '@mui/material/Paper'; | ||
import { styled } from '@mui/material/styles'; | ||
|
||
const DemoPaper = styled(Paper)(({ theme }) => ({ | ||
width: 120, | ||
height: 120, | ||
padding: theme.spacing(2), | ||
...theme.typography.body2, | ||
textAlign: 'center', | ||
})); | ||
|
||
export default function SquareCorners() { | ||
return ( | ||
<Stack direction="row" spacing={2}> | ||
<DemoPaper square={false}>rounded corners</DemoPaper> | ||
<DemoPaper square>square corners</DemoPaper> | ||
</Stack> | ||
); | ||
} |
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,21 @@ | ||
import * as React from 'react'; | ||
import Stack from '@mui/material/Stack'; | ||
import Paper from '@mui/material/Paper'; | ||
import { styled } from '@mui/material/styles'; | ||
|
||
const DemoPaper = styled(Paper)(({ theme }) => ({ | ||
width: 120, | ||
height: 120, | ||
padding: theme.spacing(2), | ||
...theme.typography.body2, | ||
textAlign: 'center', | ||
})); | ||
|
||
export default function SquareCorners() { | ||
return ( | ||
<Stack direction="row" spacing={2}> | ||
<DemoPaper square={false}>rounded corners</DemoPaper> | ||
<DemoPaper square>square corners</DemoPaper> | ||
</Stack> | ||
); | ||
} |
2 changes: 2 additions & 0 deletions
2
docs/data/material/components/paper/SquareCorners.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,2 @@ | ||
<DemoPaper square={false}>rounded corners</DemoPaper> | ||
<DemoPaper square>square corners</DemoPaper> |
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import Stack from '@mui/material/Stack'; | ||
import Paper from '@mui/material/Paper'; | ||
import { styled } from '@mui/material/styles'; | ||
|
||
const DemoPaper = styled(Paper)(({ theme }) => ({ | ||
width: 120, | ||
height: 120, | ||
padding: theme.spacing(2), | ||
...theme.typography.body2, | ||
textAlign: 'center', | ||
})); | ||
|
||
export default function Variants() { | ||
return ( | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
'& > :not(style)': { | ||
m: 1, | ||
width: 128, | ||
height: 128, | ||
}, | ||
}} | ||
> | ||
<Paper variant="outlined" /> | ||
<Paper variant="outlined" square /> | ||
</Box> | ||
<Stack direction="row" spacing={2}> | ||
<DemoPaper variant="elevation">default variant</DemoPaper> | ||
<DemoPaper variant="outlined">outlined variant</DemoPaper> | ||
</Stack> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import Stack from '@mui/material/Stack'; | ||
import Paper from '@mui/material/Paper'; | ||
import { styled } from '@mui/material/styles'; | ||
|
||
const DemoPaper = styled(Paper)(({ theme }) => ({ | ||
width: 120, | ||
height: 120, | ||
padding: theme.spacing(2), | ||
...theme.typography.body2, | ||
textAlign: 'center', | ||
})); | ||
|
||
export default function Variants() { | ||
return ( | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
'& > :not(style)': { | ||
m: 1, | ||
width: 128, | ||
height: 128, | ||
}, | ||
}} | ||
> | ||
<Paper variant="outlined" /> | ||
<Paper variant="outlined" square /> | ||
</Box> | ||
<Stack direction="row" spacing={2}> | ||
<DemoPaper variant="elevation">default variant</DemoPaper> | ||
<DemoPaper variant="outlined">outlined variant</DemoPaper> | ||
</Stack> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<Paper variant="outlined" /> | ||
<Paper variant="outlined" square /> | ||
<DemoPaper variant="elevation">default variant</DemoPaper> | ||
<DemoPaper variant="outlined">outlined variant</DemoPaper> |
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