Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

123
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda