Skip to content

Instantly share code, notes, and snippets.

@bennycode
Created January 13, 2019 20:10
Show Gist options
  • Select an option

  • Save bennycode/beedd00484c80a5e5d0724bed2a4426b to your computer and use it in GitHub Desktop.

Select an option

Save bennycode/beedd00484c80a5e5d0724bed2a4426b to your computer and use it in GitHub Desktop.
Material UI example (TypeScript)
import {createStyles, Grid, Paper, Theme, WithStyles, withStyles,} from '@material-ui/core';
import * as React from 'react';
const styles = (theme: Theme) =>
createStyles({
root: {
flexGrow: 1,
},
paper: {
padding: theme.spacing.unit * 2,
textAlign: 'center',
color: theme.palette.text.secondary,
},
});
interface Props extends WithStyles<typeof styles> {
}
interface State {
}
class Skeleton extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
}
render() {
const {classes} = this.props;
return (
<div className={classes.root}>
<Grid container spacing={24}>
<Grid item xs={12}>
<Paper className={classes.paper}>xs=12</Paper>
</Grid>
<Grid item xs={12} sm={6}>
<Paper className={classes.paper}>xs=12 sm=6</Paper>
</Grid>
<Grid item xs={12} sm={6}>
<Paper className={classes.paper}>xs=12 sm=6</Paper>
</Grid>
<Grid item xs={6} sm={3}>
<Paper className={classes.paper}>xs=6 sm=3</Paper>
</Grid>
<Grid item xs={6} sm={3}>
<Paper className={classes.paper}>xs=6 sm=3</Paper>
</Grid>
<Grid item xs={6} sm={3}>
<Paper className={classes.paper}>xs=6 sm=3</Paper>
</Grid>
<Grid item xs={6} sm={3}>
<Paper className={classes.paper}>xs=6 sm=3</Paper>
</Grid>
</Grid>
</div>
);
}
}
export default withStyles(styles)(Skeleton);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment