How to change MUI Chip's background color when filled?

Viewed 11

I want to change Chip's background color when it's variants value is 'filled' because the default light gray doesn't feel satisfactory.

I read MUI docs and Chip API but it's too complicated for me..

1 Answers

You could make use of Chip's exported CSS classes

import Chip, { chipClasses } from "@mui/material/Chip";
import { styled } from "@mui/material/styles";

// ..

const CustomChip = styled(Chip)({
  [`&.${chipClasses.filled}`]: {
    backgroundColor: "red"
  }
});

Codesandbox demo

Edit hardcore-mcnulty-258q0j

Related