Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material-ui Typography with router link always underlined

I can't seem to get rid of the underline when I add a React-Router link to a Typography element, even if underline="none" or "hover" is selected.

from useStyles:

title: {
    display: "none",
    [theme.breakpoints.up("sm")]: {
      display: "block",
    },
  },

from render (the Typography element is in a Toolbar, not sure if that makes a difference):

          <Typography
            className={classes.title}
            variant="h6"
            noWrap
            component={Link}
            to="/"
            color="textPrimary"
            underline="none"
          >
            Your Text Here
          </Typography>

in browser: enter image description here

like image 919
Victor Lazaro Avatar asked Oct 23 '25 14:10

Victor Lazaro


2 Answers

You need to specify the following in your Links CSS:

textDecoration: "none",
boxShadow: "none"
like image 113
A Webb Avatar answered Oct 26 '25 05:10

A Webb


https://material-ui.com/api/typography/ it's seems like <Typograpphy/> don't have attribute underline, but <Link> has https://material-ui.com/components/links/#links. should your text be a link? Maybe you could try something like this:

<Typography
  className={classes.title}
  variant="h6"
  noWrap
  //component={Link}
  //to="/"
  color="textPrimary"
>
  <Link to="/" underline="none">
    Your Text Here
  </Link>
</Typography>
like image 41
sueno Avatar answered Oct 26 '25 03:10

sueno



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!