Home > OS >  React, Mui Rating Component
React, Mui Rating Component

Time:09-16

I'm recently working on a project using react. I would like to know if there is a way to color the Material-UI component of the rating with custom colors.

CodePudding user response:

Actually, you can have whatever icon shape or colour that you like

Take a look at this example from Edit Material demo

CodePudding user response:

You can use this example

material-ui.com/components/rating/customize

and create a costm component in your preferred color

smt like this

const StyledRating = withStyles({
  iconFilled: {
    color: 'red',
  },
  iconHover: {
    color: 'darkred',
  },
})(Rating);
  • Related