Typography
The API documentation of the Typography React component.
Props
Name | Type | Default | Description |
---|---|---|---|
align | enum: 'inherit', 'left', 'center', 'right', 'justify' |
'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 API below for more details. | |
color | enum: 'default', 'error', 'inherit', 'primary', 'secondary', 'textPrimary', 'textSecondary' |
'default' | The color of the component. It supports those theme colors that make sense for this component. |
component | union: string | func | object |
The component used for the root node. Either a string to use a DOM element or a component. By default, it maps the variant to a good default headline component. | |
gutterBottom | bool | false | If true , the text will have a bottom margin. |
headlineMapping | object | { display4: 'h1', display3: 'h1', display2: 'h1', display1: 'h1', headline: 'h1', title: 'h2', subheading: 'h3', body2: 'aside', body1: 'p',} | We are empirically mapping the variant property to a range of different DOM element types. For instance, h1 to h6. If you wish to change that mapping, you can provide your own. Alternatively, you can use the component property. |
noWrap | bool | false | If true , the text will not wrap, but instead will truncate with an ellipsis. |
paragraph | bool | false | If true , the text will have a bottom margin. |
variant | enum: 'display4', 'display3', 'display2', 'display1', 'headline', 'title', 'subheading', 'body2', 'body1', 'caption', 'button' |
'body1' | Applies the theme typography styles. |
Any other properties supplied will be spread to the root element (native element).
CSS API
You can override all the class names injected by Material-UI thanks to the classes
property.
This property accepts the following keys:
Name | Description |
---|---|
root | Styles applied to the root element. |
display4 | Styles applied to the root element if variant="display4" . |
display3 | Styles applied to the root element if variant="display3" . |
display2 | Styles applied to the root element if variant="display2" . |
display1 | Styles applied to the root element if variant="display1" . |
headline | Styles applied to the root element if variant="headline" . |
title | Styles applied to the root element if variant="title" . |
subheading | Styles applied to the root element if variant="subheading" . |
body2 | Styles applied to the root element if variant="body2" . |
body1 | Styles applied to the root element if variant="body1" . |
caption | Styles applied to the root element if variant="caption" . |
button | Styles applied to the root element if variant="button" . |
alignLeft | Styles applied to the root element if align="left" . |
alignCenter | Styles applied to the root element if align="center" . |
alignRight | Styles applied to the root element if align="right" . |
alignJustify | Styles applied to the root element if align="justify" . |
noWrap | Styles applied to the root element if align="nowrap" . |
gutterBottom | Styles applied to the root element if gutterBottom={true} . |
paragraph | Styles applied to the root element if paragraph={true} . |
colorInherit | Styles applied to the root element if color="inherit" . |
colorPrimary | Styles applied to the root element if color="primary" . |
colorSecondary | Styles applied to the root element if color="secondary" . |
colorTextPrimary | Styles applied to the root element if color="textPrimary" . |
colorTextSecondary | Styles applied to the root element if color="textSecondary" . |
colorError | Styles applied to the root element if color="error" . |
Have a look at overriding with classes section and the implementation of the component for more detail.
If using the overrides
key of the theme as documented
here,
you need to use the following style sheet name: MuiTypography
.