-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Improve the docs of the Grid component
- Loading branch information
1 parent
c3aab53
commit 07f39eb
Showing
33 changed files
with
279 additions
and
373 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import * as React from 'react'; | ||
import { experimentalStyled as styled } from '@material-ui/core/styles'; | ||
import Box from '@material-ui/core/Box'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import Grid from '@material-ui/core/Grid'; | ||
|
||
const Item = styled(Paper)(({ theme }) => ({ | ||
// TODO withStyles removal | ||
...theme.typography.body2, | ||
padding: theme.spacing(1), | ||
textAlign: 'center', | ||
color: theme.palette.text.secondary, | ||
})); | ||
|
||
export default function BasicGrid() { | ||
return ( | ||
<Box sx={{ flexGrow: 1 }}> | ||
<Grid container spacing={2}> | ||
<Grid item xs={8}> | ||
<Item>xs=8</Item> | ||
</Grid> | ||
<Grid item xs={4}> | ||
<Item>xs=4</Item> | ||
</Grid> | ||
<Grid item xs={4}> | ||
<Item>xs=4</Item> | ||
</Grid> | ||
<Grid item xs={8}> | ||
<Item>xs=8</Item> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
); | ||
} |
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,35 @@ | ||
import * as React from 'react'; | ||
import { experimentalStyled as styled } from '@material-ui/core/styles'; | ||
import Box from '@material-ui/core/Box'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import Grid from '@material-ui/core/Grid'; | ||
import * as CSS from 'csstype'; | ||
|
||
const Item = styled(Paper)(({ theme }) => ({ | ||
// TODO withStyles removal | ||
...(theme.typography.body2 as CSS.Properties), | ||
padding: theme.spacing(1), | ||
textAlign: 'center', | ||
color: theme.palette.text.secondary, | ||
})); | ||
|
||
export default function BasicGrid() { | ||
return ( | ||
<Box sx={{ flexGrow: 1 }}> | ||
<Grid container spacing={2}> | ||
<Grid item xs={8}> | ||
<Item>xs=8</Item> | ||
</Grid> | ||
<Grid item xs={4}> | ||
<Item>xs=4</Item> | ||
</Grid> | ||
<Grid item xs={4}> | ||
<Item>xs=4</Item> | ||
</Grid> | ||
<Grid item xs={8}> | ||
<Item>xs=8</Item> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
); | ||
} |
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,69 +1,33 @@ | ||
import * as React from 'react'; | ||
import { experimentalStyled as styled } from '@material-ui/core/styles'; | ||
import Box from '@material-ui/core/Box'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import Divider from '@material-ui/core/Divider'; | ||
import Grid from '@material-ui/core/Grid'; | ||
|
||
const Item = styled(Paper)(({ theme }) => ({ | ||
// TODO withStyles removal | ||
...theme.typography.body2, | ||
padding: theme.spacing(1), | ||
textAlign: 'center', | ||
color: theme.palette.text.secondary, | ||
whiteSpace: 'nowrap', | ||
marginBottom: theme.spacing(1), | ||
})); | ||
|
||
export default function CSSGrid() { | ||
return ( | ||
<div> | ||
<Typography variant="subtitle1" gutterBottom component="div"> | ||
Material-UI Grid: | ||
</Typography> | ||
<Grid container spacing={3}> | ||
<Grid item xs={3}> | ||
<Item>xs=3</Item> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<Item>xs=3</Item> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<Item>xs=3</Item> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<Item>xs=3</Item> | ||
</Grid> | ||
<Grid item xs={8}> | ||
<Box sx={{ width: 1 }}> | ||
<Box display="grid" gridTemplateColumns="repeat(12, 1fr)" gap={2}> | ||
<Box gridColumn="auto / span 8"> | ||
<Item>xs=8</Item> | ||
</Grid> | ||
<Grid item xs={4}> | ||
<Item>xs=4</Item> | ||
</Grid> | ||
</Grid> | ||
<Divider sx={{ my: 2 }} /> | ||
<Typography variant="subtitle1" gutterBottom component="div"> | ||
CSS Grid Layout: | ||
</Typography> | ||
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: 3 }}> | ||
<Box sx={{ gridColumnEnd: 'span 3' }}> | ||
<Item>xs=3</Item> | ||
</Box> | ||
<Box sx={{ gridColumnEnd: 'span 3' }}> | ||
<Item>xs=3</Item> | ||
</Box> | ||
<Box sx={{ gridColumnEnd: 'span 3' }}> | ||
<Item>xs=3</Item> | ||
<Box gridColumn="auto / span 4"> | ||
<Item>xs=4</Item> | ||
</Box> | ||
<Box sx={{ gridColumnEnd: 'span 3' }}> | ||
<Item>xs=3</Item> | ||
<Box gridColumn="auto / span 4"> | ||
<Item>xs=4</Item> | ||
</Box> | ||
<Box sx={{ gridColumnEnd: 'span 8' }}> | ||
<Box gridColumn="auto / span 8"> | ||
<Item>xs=8</Item> | ||
</Box> | ||
<Box sx={{ gridColumnEnd: 'span 4' }}> | ||
<Item>xs=4</Item> | ||
</Box> | ||
</Box> | ||
</div> | ||
</Box> | ||
); | ||
} |
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,69 +1,34 @@ | ||
import * as React from 'react'; | ||
import { experimentalStyled as styled } from '@material-ui/core/styles'; | ||
import Box from '@material-ui/core/Box'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import Divider from '@material-ui/core/Divider'; | ||
import Grid from '@material-ui/core/Grid'; | ||
import * as CSS from 'csstype'; | ||
|
||
const Item = styled(Paper)(({ theme }) => ({ | ||
// TODO withStyles removal | ||
...(theme.typography.body2 as CSS.Properties), | ||
padding: theme.spacing(1), | ||
textAlign: 'center', | ||
color: theme.palette.text.secondary, | ||
whiteSpace: 'nowrap', | ||
marginBottom: theme.spacing(1), | ||
})); | ||
|
||
export default function CSSGrid() { | ||
return ( | ||
<div> | ||
<Typography variant="subtitle1" gutterBottom component="div"> | ||
Material-UI Grid: | ||
</Typography> | ||
<Grid container spacing={3}> | ||
<Grid item xs={3}> | ||
<Item>xs=3</Item> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<Item>xs=3</Item> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<Item>xs=3</Item> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<Item>xs=3</Item> | ||
</Grid> | ||
<Grid item xs={8}> | ||
<Box sx={{ width: 1 }}> | ||
<Box display="grid" gridTemplateColumns="repeat(12, 1fr)" gap={2}> | ||
<Box gridColumn="auto / span 8"> | ||
<Item>xs=8</Item> | ||
</Grid> | ||
<Grid item xs={4}> | ||
<Item>xs=4</Item> | ||
</Grid> | ||
</Grid> | ||
<Divider sx={{ my: 2 }} /> | ||
<Typography variant="subtitle1" gutterBottom component="div"> | ||
CSS Grid Layout: | ||
</Typography> | ||
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: 3 }}> | ||
<Box sx={{ gridColumnEnd: 'span 3' }}> | ||
<Item>xs=3</Item> | ||
</Box> | ||
<Box sx={{ gridColumnEnd: 'span 3' }}> | ||
<Item>xs=3</Item> | ||
</Box> | ||
<Box sx={{ gridColumnEnd: 'span 3' }}> | ||
<Item>xs=3</Item> | ||
<Box gridColumn="auto / span 4"> | ||
<Item>xs=4</Item> | ||
</Box> | ||
<Box sx={{ gridColumnEnd: 'span 3' }}> | ||
<Item>xs=3</Item> | ||
<Box gridColumn="auto / span 4"> | ||
<Item>xs=4</Item> | ||
</Box> | ||
<Box sx={{ gridColumnEnd: 'span 8' }}> | ||
<Box gridColumn="auto / span 8"> | ||
<Item>xs=8</Item> | ||
</Box> | ||
<Box sx={{ gridColumnEnd: 'span 4' }}> | ||
<Item>xs=4</Item> | ||
</Box> | ||
</Box> | ||
</div> | ||
</Box> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.