Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

363
Visualizações
How to change color of ripple effect in button in material ui

I'm trying to change the ripple color effect of a button in Material UI 5. I have tried a lot of different solutions from the Internet, but none of them seems to be working. This is my component:

import React, { MouseEventHandler } from "react";
import { Button as MaterialButton } from "@mui/material";
import { styled } from "@mui/material/styles";

const StyledButton = styled(MaterialButton)({
  boxShadow: "none",
  backgroundColor: "rgb(74, 144, 223)",
  padding: "10px 20px",
  border: "none",
  outline: "none",
  borderRadius: "5px",
  width: "150px",
  "&:hover": {
    backgroundColor: "rgb(83, 162, 255)",
  },
  "&:disabled": {
    backgroundColor: "rgba(74, 144, 226, 0.5)",
    color: "white",
  },
});

type ButtonProps = {
  text: string;
  onClick: MouseEventHandler<HTMLButtonElement>;
  disabled: boolean;
};

export const Button = (props: ButtonProps) => {
  const { text, onClick, disabled } = props;

  return (
    <StyledButton disabled={disabled} variant="contained" onClick={onClick}>
      {text}
    </StyledButton>
  );
};

Button.defaultProps = {
  disabled: false,
};

Any idea how to change it? Right now the ripple effect is computed based on the color property, so if I change it to red both the ripple effect and the font will be shown with a red color. The problem is that I want to change the ripple effect color without modifying the color of the font.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda