0

I want to change the nav link icon color. If I set the primary color by creating a custom theme it won't effect.

<ThemeProvider
  theme={{
    palette: {
      themePrimary: getTheme().palette.teal,
    }
  }}
>

Actually it worked on hover but not on normal view. I tried setting the iconProps but it didn't work either.

links: [
  {
    name: "Overview",
    icon: "WebAppBuilderFragment",
    iconProps: { color: "white" },
  },
],

How can I change these icons color?

enter image description here

abdllhcay
  • 69
  • 2
  • 6

1 Answers1

1

IconProps is an object with following props. Use styles to set icon color:

links: [
  {
    name: "Overview",
    iconProps: {
      iconName: 'WebAppBuilderFragment',
      styles: {
        root: { color: '#f00' },
      },
    },
  },
],

Codepen working example.

Marko Savic
  • 2,159
  • 2
  • 14
  • 27