Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change active tab color in MUI?

How I can change the color of the active tab?

I mean, this pink line, look at the pic.

enter image description here

like image 984
none Avatar asked May 19 '16 13:05

none


People also ask

How do I change inactive tab color in MUI?

It can be done by using the &. Mui-selected selector.

How do I change the background color of a material UI tab?

1, you can do this: import Tabs from '@material-ui/core/Tabs'; import { withStyles } from '@material-ui/core/styles'; const StyledTabs = withStyles({ indicator: { backgroundColor: 'orange' } })(Tabs);


2 Answers

You can try this material UI latest version support TabIndicatorProps through which you can pass style key.

<Tabs TabIndicatorProps={{style: {background:'ANY_COLOR'}}}>...... 
like image 161
Arham Awan Avatar answered Sep 18 '22 09:09

Arham Awan


Well, you have two options:

You could customize the theme:
http://www.material-ui.com/#/customization/themes

But the easiest way would be using the inkBarStyle property.
You can see it in the docs..
Example:

<Tabs inkBarStyle={{background: 'blue'}}>... 
like image 36
André Junges Avatar answered Sep 17 '22 09:09

André Junges