How can I change the underline color of MaterialUI's React Tabs component?
Asked Answered
I

5

5

I noticed there is no documentation on MaterialUI's website in regard to changing the underline color of their Tabs component...

http://www.material-ui.com/#/components/tabs

Igloo answered 26/1, 2018 at 16:58 Comment(0)
I
-1

This property can be changed with the inkBarStyle props:

<Tabs inkBarStyle={{backgroundColor: '#e77600'}}>
   <Tab label='Tab 1'/>
   <Tab label='Tab 2'/>
</Tabs>
Igloo answered 26/1, 2018 at 16:58 Comment(0)
G
17

Use TabIndicatorProps property to change the underline color.

<Tabs TabIndicatorProps={{style: {backgroundColor: "white"}}}>
   <Tab label='Tab 1'/>
   <Tab label='Tab 2'/>
</Tabs>
Grubb answered 2/1, 2019 at 6:43 Comment(0)
D
1

If you want to configure this in MUI v5 by overriding the style in your custom theme, you can use this:

MuiTabs: {
  defaultProps: {
    TabIndicatorProps: { style: { backgroundColor: '#e77600' } },
  },
}
Duala answered 19/4, 2023 at 7:32 Comment(0)
I
-1

This property can be changed with the inkBarStyle props:

<Tabs inkBarStyle={{backgroundColor: '#e77600'}}>
   <Tab label='Tab 1'/>
   <Tab label='Tab 2'/>
</Tabs>
Igloo answered 26/1, 2018 at 16:58 Comment(0)
E
-2
<Tabs indicatorColor="white">
   <Tab label="Tab 1"/>
   <Tab label="Tab 2"/>
</Tabs>

Indicator Color can take any color e.g white, red, green e.t.c

Expound answered 22/1, 2019 at 17:43 Comment(0)
A
-2

In the latest material ui version v4.9.11, you need to use indicator props to apply underline color

<Tabs indicator={{backgroundColor: '#e77600'}}>
   <Tab label='Tab 1'/>
   <Tab label='Tab 2'/>
</Tabs>
Abruption answered 20/4, 2020 at 11:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.