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

129
Views
How would I make a MUI button take up the entirety of a Grid?

I have a Grid which needs to be a square that is responsive to window size, and inside this grid is a button which should take up the entirety of the grid. Currently, the grid resizes properly, but the contents inside of it do not take up the full size of the Grid. Here is my code

galleryButtonContainer: {
    width: '100%',
    height: 0,
    paddingBottom: '100%',
    borderRadius: '20%',
    backgroundColor: theme.palette.grey.light,
    '&:hover': {
      backgroundColor: theme.palette.grey.light,
    },
  },
  image: {
    objectFit: 'cover',
    width: '100%',
    height: '100%',
    borderRadius: '20%',
  },
  thumbnailIcon: {
    width: '50%',
    height: '50%',
  },
<Grid className={classes.galleryButtonContainer}>
  <Button
    onClick={() =>
      toPage(
        `/gallery/view/organizationEvent/${data.organizationEventId}`
      )
    }
  >
    {hasPhotos ? (
      <img
        src={thumbnail}
        alt="gallery thumbnail"
        className={classes.image}
      />
    ) : (
      <PhotoLibraryIcon className={classes.thumbnailIcon} />
    )}
  </Button>
</Grid>

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!