Typography API
API reference docs for the React Typography component. Learn about the props, CSS, and other APIs of this exported module.
Demos
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 of the native component are also available.
Name | Type | Default | Description |
---|---|---|---|
align | 'center' | 'inherit' | 'justify' | 'left' | 'right' | 'inherit' | Set the text-align on the component. |
children | node | - | The content of the component. |
classes | object | - | Override or extend the styles applied to the component. See CSS classes API below for more details. |
component | elementType | - | The component used for the root node. Either a string to use a HTML element or a component. |
gutterBottom | bool | false | If |
noWrap | bool | false | If |
paragraph | bool | false | If |
sx | Array<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. |
variantMapping | object | { 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 |
system
properties. You can use them as props directly on the component.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.
These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.
Class name | Rule name | Description |
---|---|---|
.MuiTypography-alignCenter | alignCenter | Styles applied to the root element if align="center" . |
.MuiTypography-alignJustify | alignJustify | Styles applied to the root element if align="justify" . |
.MuiTypography-alignLeft | alignLeft | Styles applied to the root element if align="left" . |
.MuiTypography-alignRight | alignRight | Styles applied to the root element if align="right" . |
.MuiTypography-body1 | body1 | Styles applied to the root element if variant="body1" . |
.MuiTypography-body2 | body2 | Styles applied to the root element if variant="body2" . |
.MuiTypography-button | button | Styles applied to the root element if variant="button" . |
.MuiTypography-caption | caption | Styles applied to the root element if variant="caption" . |
.MuiTypography-gutterBottom | gutterBottom | Styles applied to the root element if gutterBottom={true} . |
.MuiTypography-h1 | h1 | Styles applied to the root element if variant="h1" . |
.MuiTypography-h2 | h2 | Styles applied to the root element if variant="h2" . |
.MuiTypography-h3 | h3 | Styles applied to the root element if variant="h3" . |
.MuiTypography-h4 | h4 | Styles applied to the root element if variant="h4" . |
.MuiTypography-h5 | h5 | Styles applied to the root element if variant="h5" . |
.MuiTypography-h6 | h6 | Styles applied to the root element if variant="h6" . |
.MuiTypography-inherit | inherit | Styles applied to the root element if variant="inherit" . |
.MuiTypography-noWrap | noWrap | Styles applied to the root element if nowrap={true} . |
.MuiTypography-overline | overline | Styles applied to the root element if variant="overline" . |
.MuiTypography-paragraph | paragraph | Styles applied to the root element if paragraph={true} . |
.MuiTypography-root | root | Styles applied to the root element. |
.MuiTypography-subtitle1 | subtitle1 | Styles applied to the root element if variant="subtitle1" . |
.MuiTypography-subtitle2 | subtitle2 | Styles applied to the root element if variant="subtitle2" . |
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverrides
property in a custom theme.