reactjsgridmaterial-designmaterial-uigrid-layout

material UI grid layout design


Im completely new to Material UI and im trying to make use of Grid concept to position my components in much dynamic way. I would like to create the grids in the following pattern and i'm stuck in finding out a solution to create two column grid having different number of rows or items.

Below is the sample layout which im trying to design using grids so, can somebody please share any ideas to achieve it?

Sample code would be more helpful. Screenshot of my planned design


Solution

  • To get the Grid format in material UI, follow this docs. You can try like this, with multiple nested grid containers to achieve what you expect.

    Edit Material demo

       <div>
          <Grid
            container
            spacing={1}
            direction="row"
            justify="flex-start"
            alignItems="flex-start"
          >
            <Grid container item xs={4} spacing={1}>
              <Grid item xs={12}>
              <Paper>Some Text </Paper>
              </Grid>
              <Grid item xs={12}>
              <Paper  style={{height:400}}>Component A</Paper>
              </Grid>
            </Grid>
            <Grid container item xs={8} spacing={1} >
            <Grid item xs={12}>
                <Paper  style={{height:200}}>Component B</Paper>
              </Grid>
              <Grid item xs={12}>
                <Paper  style={{height:200}}>Component C</Paper>
              </Grid>
            </Grid>
          </Grid>
        </div>