The Typography component follows the Material Design typographic scale that provides a limited set of type sizes that work well together for a consistent layout.
h1. Heading
h2. Heading
h3. Heading
h4. Heading
h5. Heading
h6. Heading
subtitle1. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos blanditiis tenetur
subtitle2. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos blanditiis tenetur
body1. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos blanditiis tenetur unde suscipit, quam beatae rerum inventore consectetur, neque doloribus, cupiditate numquam dignissimos laborum fugiat deleniti? Eum quasi quidem quibusdam.
body2. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos blanditiis tenetur unde suscipit, quam beatae rerum inventore consectetur, neque doloribus, cupiditate numquam dignissimos laborum fugiat deleniti? Eum quasi quidem quibusdam.
button textcaption textoverline text
Theme keys
In some situations you might not be able to use the Typography component.
Hopefully, you might be able to take advantage of the typography keys of the theme.
This div's text looks like that of a button.
<Div>{"This div's text looks like that of a button."}</Div>
Press Enter to start editing
Customization
Adding & disabling variants
In addition to using the default typography variants, you can add custom ones, or disable any you don't need. See the Adding & disabling variants page for more info.
Changing the semantic element
The Typography component uses the variantMapping prop to associate a UI variant with a semantic element.
It's important to realize that the style of a typography component is independent from the semantic underlying element.
To change the underlying element for a one-off situation, like avoiding two h1 elements in your page, use the component prop:
As a CSS utility component, the Typography component supports all system properties. You can use them as prop directly on the component.
For example, here's how you'd add a margin-top:
<Typographymt={2}>
Accessibility
Key factors to follow for an accessible typography:
Color. Provide enough contrast between text and its background, check out the minimum recommended WCAG 2.0 color contrast ratio (4.5:1).
Font size. Use relative units (rem), instead of pixels, to accommodate the user's browser settings.