question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typography span variant

See original GitHub issue

Both defaultHeadlineMapping variants body1 and body2 - p (paragraph) tag. Other variants are block-types too (h1-h6) and no one inline/inline-block.

I can do this by

component={(props) => {
  return <span
    {...props}
  />
}}

or

variant="body2"
headlineMapping={{
  body2: 'span',
}}

But it’s not useful.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

17reactions
kross-italkcommented, Jul 29, 2019

This is the #1 result for “material ui typography span inline text” and there is no accepted answer. There is nothing on Stack overflow for this question. You need to treat your community better

12reactions
joshwoodingcommented, Aug 1, 2019

@kross-italk I think it’s kind of unfair to accuse us of treating our community badly considering how much time we spend answering questions and improving Material UI. Now to answer your question:

We changed Typography‘s implementation in v4 so it uses the default display for the element you choose i.e. inline for span. If you want to override this you can use the display prop e.g. display="inline"

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typography span variant #13196 - mui/material-ui - GitHub
This is the #1 result for "material ui typography span inline text" and there is no accepted answer. There is nothing on Stack...
Read more >
Typography API - Material UI - MUI
API reference docs for the React Typography component. ... The component maps the variant prop to a range of different HTML element types....
Read more >
Material-UI Typography Tutorial and Examples | React.School
There are also overline and caption caption variants which are both smaller font sized <span> components. Typography Usage. The default <Typography> with no ......
Read more >
How to make MUI Typography without newline? - Stack Overflow
So, as we all know "span" is an "inline" component and next element (if it ... To remove the newline in all Typography...
Read more >
font-variant - CSS: Cascading Style Sheets - MDN Web Docs
The font-variant CSS shorthand property allows you to set all the font variants for a font.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found