Ask Your Question
2

What is the way to replace the default color of mui/material/Tab font (react)?

asked 2023-07-03 13:25:03 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-07-03 13:40:03 +0000

qstack gravatar image

You can use the makeStyles function from @material-ui/core/styles to create custom styles for your Tab component and use the color property to set a new font color. Here's an example code:

import { makeStyles } from '@material-ui/core/styles';
import { Tab } from '@material-ui/core';

const useStyles = makeStyles((theme) => ({
  myCustomTab: {
    color: 'red', // set your desired font color here
  },
}));

function MyComponent() {
  const classes = useStyles();

  return (
    <Tab label="My Tab" className={classes.myCustomTab} />
  );
}

In this example, the myCustomTab style class is created with a color property set to 'red'. Then, the Tab component is rendered with the myCustomTab class name applied to it.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-03 13:25:03 +0000

Seen: 12 times

Last updated: Jul 03 '23