How do you change the Stepper color on React Material UI?

前端 未结 7 1248
不知归路
不知归路 2021-02-14 01:17

In the screenshot above, I am trying to change the step color to either: green for correct, yellow for in-progress and red for incorrect.

How could I do this?

7条回答
  •  深忆病人
    2021-02-14 01:36

    Update: Here is correct way for latest version 3. You just need to add the overrides correctly to your theme by referencing MuiStepIcon:

    const theme = createMuiTheme({
      overrides: {
       MuiStepIcon: {
        root: {
          '&$completed': {
            color: 'pink',
          },
          '&$active': {
            color: 'red',
          },
        },
        active: {},
        completed: {},
      },
      palette: {
        ...
      }
    })
    

提交回复
热议问题