Skip to content

Typography API

API reference docs for the React Typography component. Learn about the props, CSS, and other APIs of this exported module.

Demos

For examples and details on the usage of this React component, visit the component demo pages:

Import

import Typography from '@mui/material/Typography';
// or
import { Typography } from '@mui/material';
Learn about the difference by reading this guide on minimizing bundle size.

Props

Props of the native component are also available.

NameTypeDefaultDescription
align'center'
| 'inherit'
| 'justify'
| 'left'
| 'right'
'inherit'

Set the text-align on the component.

childrennode

The content of the component.

classesobject

Override or extend the styles applied to the component.

See CSS API below for more details.

componentelementType

The component used for the root node. Either a string to use a HTML element or a component.

gutterBottomboolfalse

If true, the text will have a bottom margin.

noWrapboolfalse

If true, the text will not wrap, but instead will truncate with a text overflow ellipsis.
Note that text overflow can only happen with block or inline-block level elements (the element needs to have a width in order to overflow).

paragraphboolfalse

If true, the element will be a paragraph element.

sxArray<func
| object
| bool>
| func
| object

The system prop that allows defining system overrides as well as additional CSS styles.

See the `sx` page for more details.

variant'body1'
| 'body2'
| 'button'
| 'caption'
| 'h1'
| 'h2'
| 'h3'
| 'h4'
| 'h5'
| 'h6'
| 'inherit'
| 'overline'
| 'subtitle1'
| 'subtitle2'
| string
'body1'

Applies the theme typography styles.

variantMappingobject{ h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h4', h5: 'h5', h6: 'h6', subtitle1: 'h6', subtitle2: 'h6', body1: 'p', body2: 'p', inherit: 'p', }

The component maps the variant prop to a range of different HTML element types. For instance, subtitle1 to <h6>. If you wish to change that mapping, you can provide your own. Alternatively, you can use the component prop.

As a CSS utility, the Typography component also supports all system properties. You can use them as props directly on the component.

The ref is forwarded to the root element.

Theme default props

You can use MuiTypography to change the default props of this component with the theme.


CSS

The following class names are useful for styling with CSS (the state classes are marked).
To learn more, visit the component customization page.

Global classRule nameDescription
.MuiTypography-rootrootStyles applied to the root element.
.MuiTypography-body2body2Styles applied to the root element if variant="body2".
.MuiTypography-body1body1Styles applied to the root element if variant="body1".
.MuiTypography-captioncaptionStyles applied to the root element if variant="caption".
.MuiTypography-buttonbuttonStyles applied to the root element if variant="button".
.MuiTypography-h1h1Styles applied to the root element if variant="h1".
.MuiTypography-h2h2Styles applied to the root element if variant="h2".
.MuiTypography-h3h3Styles applied to the root element if variant="h3".
.MuiTypography-h4h4Styles applied to the root element if variant="h4".
.MuiTypography-h5h5Styles applied to the root element if variant="h5".
.MuiTypography-h6h6Styles applied to the root element if variant="h6".
.MuiTypography-subtitle1subtitle1Styles applied to the root element if variant="subtitle1".
.MuiTypography-subtitle2subtitle2Styles applied to the root element if variant="subtitle2".
.MuiTypography-overlineoverlineStyles applied to the root element if variant="overline".
.MuiTypography-inheritinheritStyles applied to the root element if variant="inherit".
.MuiTypography-alignLeftalignLeftStyles applied to the root element if align="left".
.MuiTypography-alignCenteralignCenterStyles applied to the root element if align="center".
.MuiTypography-alignRightalignRightStyles applied to the root element if align="right".
.MuiTypography-alignJustifyalignJustifyStyles applied to the root element if align="justify".
.MuiTypography-noWrapnoWrapStyles applied to the root element if nowrap={true}.
.MuiTypography-gutterBottomgutterBottomStyles applied to the root element if gutterBottom={true}.
.MuiTypography-paragraphparagraphStyles applied to the root element if paragraph={true}.

You can override the style of the component using one of these customization options: