Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

368
Views
How to styling a card from rectangular to square

everyone, i have a frontend code that displaying card with rectangular but i want to display it in square, please help since i have tried so many time and didn't change to square

const useStyles = makeStyles({
  gridContainer: {
    paddingLeft: "40px",
    paddingRight: "40px",
    // borderWidth:100
  },
  root: {
    // minWidth:50,
    flex:1
  },
  bullet: {
    display: "inline-block",
    margin: "0 2px",
    transform: "scale(0.8)",
  },
  title: {
    fontSize: 14,
  },
  pos: {
    marginBottom: 12,
  },
});

function Home() {

  return (
    <div>
      <div>
        <h1>Product List</h1>
      </div>
      <Grid
            container
            spacing={4}
            className={classes.gridContainer}
            justify="center"
          >
      {getData.map((x, index) => {
        return (
            <Grid key={index} item xs={12} sm={6} md={4} style={{ 
              flex: 1,
              flexDirection: "row",
              justifyContent: "center",
              alignItems: "stretch",
            }}
            >
              <Card className={classes.root} variant="outlined">
                <CardContent>
                  <Typography className={classes.pos} color="textSecondary">
                    <center>
                      {x.sku}
                    </center>
                  </Typography>
                  <Typography className={classes.pos} color="textSecondary">
                    <center>
                      {x.name}
                    </center>
                  </Typography>
                  <Typography className={classes.pos} color="textSecondary">
                    <center>
                      {x.price}
                    </center>
                  </Typography>
                </CardContent>
              </Card>
            </Grid>
        );
      })}
      </Grid>
    </div>
  );
}

From above, it shows that card will display in rectangular

Current output Card

I'm struggle with the styling issue so please advise and correct me if i'm wrong, thanks :)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!