I noticed there is no documentation on MaterialUI's website in regard to changing the underline color of their Tabs component...
How can I change the underline color of MaterialUI's React Tabs component?
Asked Answered
This property can be changed with the inkBarStyle props:
<Tabs inkBarStyle={{backgroundColor: '#e77600'}}>
<Tab label='Tab 1'/>
<Tab label='Tab 2'/>
</Tabs>
Use TabIndicatorProps
property to change the underline color.
<Tabs TabIndicatorProps={{style: {backgroundColor: "white"}}}>
<Tab label='Tab 1'/>
<Tab label='Tab 2'/>
</Tabs>
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' } },
},
}
This property can be changed with the inkBarStyle props:
<Tabs inkBarStyle={{backgroundColor: '#e77600'}}>
<Tab label='Tab 1'/>
<Tab label='Tab 2'/>
</Tabs>
<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
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>
© 2022 - 2024 — McMap. All rights reserved.