Im trying to create a dynamic, responsive grid. Just like any standard movie website. in my react project.
I have tried material-ui grid component but am unable to justify the children to flex-start whilst also centering the parent container. i can justify-content center but this looks strange if the bottom row is not full.
const styles = theme => ({
root: {
flexGrow: 1,
},
paper: {
height: 140,
width: 100,
},
control: {
padding: theme.spacing.unit * 2,
},
});
class Movies extends React.Component {
state = {
spacing: '16',
};
render() {
const { classes } = this.props;
const { spacing } = this.state;
return (
<Grid container className={classes.root} spacing={16}>
<Grid item xs={12}>
<Grid container className={classes.demo} justify="flex-start" spacing={Number(spacing)}>
{[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15].map(value => (
<Grid key={value} item>
<Paper className={classes.paper} />
</Grid>
))}
</Grid>
</Grid>
</Grid>
);
}
}
i expect the parent container/child items to be centered.
here is the output:
if there is another way of creating a responsive movie grid, please let me know.