How to use theme colors for "color" prop used in MaterialUI components

  javascript, material-ui, reactjs

Trying to use the colors from my Mui pallete as values for color prop like so:

Example:

  <Tabs
    indicatorColor="primary.mainGradient"
  >
    <Tab />
  </Tabs>

But that doesnt work, Ive also tried using useTheme like so:

indicatorColor={theme.palette.primary.mainGradient}

That didn’t work either. How can I use other colors other than primary for color props?

Source: Ask Javascript Questions

LEAVE A COMMENT