Skip to main content

Typography

Examples

Check out the Usage section for details about how to use the typography component properly, and the different configuration options we provide.

Basic example

You can use the typography component to flag content with a semantic label that determines its formatting and html tag.

<Typography variant="body-medium">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</Typography>

Variant example

You can use the variant prop to apply different styles and html tags to the text.

<Typography variant="blockquote-medium">
This is a blockquote.
</Typography>

All variant examples

Tag example

You can use the tag prop to set which HTML tag to use instead of letting the typography variant determine the tag.

Warning: When selecting an alternate tag, ensure that the selected tag maintains semantic meaning and supports accessible HTML practices.

For more information, see the usage guidelines.

In this example, the text is wrapped in a span tag and formatted to have small text.

<Typography variant="body-small" tag="span">
This is a span that is formatted to have small text.
</Typography>