See this question here: How change active tab color in React material-ui?
And this answer here: https://stackoverflow.com/a/37332913/4561887
The answer they gave works:
<Tabs inkBarStyle={{background: 'blue'}}>...
But I'd also like to change the inkBarStyle to be black and thicker.
Here's the Material-UI Tabs documentation where I found the inkBarStyle
Tabs property: http://www.material-ui.com/#/components/tabs.
Here's what I've tried. All have failed:
<Tabs inkBarStyle={{background: 'black'}, {background-size: 100% 300%}}>
<Tabs inkBarStyle={{background: 'black', background-size: 100% 300%}}>
<Tabs inkBarStyle={{background: 'black', height: 100px}}>
etc.
Also, where do I find a list of possible inkBarStyle options I can set here, and how do I set multiple options at once? Can I use any CSS property here? Ex: list: http://www.htmldog.com/references/css/properties/
Please be nice: I'm an embedded (microcontroller) programmer here trying to modify a GUI. Way out of my league here...
If you inspect that
ink
element you'll see it's thickness is defined by it'sheight
.So you'd need to pass besides the
background
is theheight
value you want.. i.e.The
marginTop
value is needed so the ink doesn't go outside the Tab element. You can play around it here:https://codesandbox.io/s/jpnr541543
Hello.js component has the tabs related code.
The inkBarStyle solution has been deprecated.
You can now use the TabIndicatorProps to style the active indicator color & thickness with the current version of MUI (4.10.02). Docs available here.
Here's how to do it using className: {classes}
indicator: {backgroundColor: ""} changes the active indicator color
indicator: {height: ""} changes the active indicator thickness
indicator: {top: ""} positions the active indicator from the top of the wrapper
tabsWrapper: {height: ""} changes the height of
<Tabs/>
. It is necessary to change this if your indicator is too thick until it is outside .tabsWrapper: {backgroundColor: ""} changes the backgroundColor of
<Tabs/>
You can also check out my sandbox here for further reference. Hope this helps!