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

127
Views
Is there a way to make the dot badge in Material-UI bigger?

I have a badge component that needs to work as an indicator. I don't need the badge to display any values so I used the dot variant, but it is really small. I assume I could modify it with CSS but is not working for some reason. Any help or tips?

const useStyles = makeStyles((theme)=>({
  dot: {
    borderRadius: 4,
    height: 8,
    minWidth:8,
  }
}));
function NotesBadge({hasNotes}){
  const classes=useStyles();
  return(
    <Badge
      className={{dot: classes.dot}}
      anchorOrigin={{
        vertical:'top',
        horizontal:'right',}}
        variant="dot"
        color="primary"
        invisible={!hasNotes}>
    </Badge>
  );
}
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

This className={{dot: classes.dot}} applies styles to the dot wrapper span. To target the actual span, which is creating the dot, you can target the MuiBadge-dot class.

Updated makeStyles

dot: {
"& .MuiBadge-dot": {
    height: 20,
    minWidth: 20,
    borderRadius: 10
  }
}

Updated Badge component.

<Badge
  className={{dot: classes.dot}}
  anchorOrigin={{
  vertical:'top',
  horizontal:'right',}}
  variant="dot"
  color="primary"
  invisible={!hasNotes}>
</Badge>

codesandbox

about 4 years ago · Juan Pablo Isaza Report

0

If you want the dot variant to be as big as the standard variant, set the badgeContent to an empty string:

<Badge color="secondary" badgeContent="">
  <MailIcon />
</Badge>

But if you want a custom size, you need to override the dot class name like below:

import Badge, { badgeClasses } from "@mui/material/Badge";
<Badge
  color="secondary"
  variant="dot"
  sx={{
    [`& .${badgeClasses.dot}`]: {
      width: size,
      height: size,
      borderRadius: "50%"
    }
  }}
>

Live Demo

Codesandbox Demo

about 4 years ago · Juan Pablo Isaza Report
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!