Text

Use the Text component to control font size, weight, alignment, and color.

Text
<Text fontSize={4}>
  Text
</Text>
Centered Text
<Text textAlign='center'>
  Centered Text
</Text>
Bold Text
<Text bold>
  Bold Text
</Text>
Caps Text
<Text caps>
  Caps Text
</Text>
Blue Text
<Text color='primary'>
  Blue Text
</Text>

HTML Elements

By default, the <Text /> component renders a <div> element. To use a <span> or <p> element, use the following:

This is a span element

This is a p element

This is an s element
<Text.span>This is a span element</Text.span>
<Text.p>This is a p element</Text.p>
<Text.s>This is an s element</Text.s>

Props

PropTypeDescription
alignstringSets the text-align property (deprecated - use textAlign)
boldbooleanSets font-weight: props.theme.bold
capsbooleanSets styles for all-caps type treatments
colorstringSets color based on the theme's color palette
displaystringSets css display value, eg. none, inline, etc
fontSizenumber or stringSets font size based on the typographic scale
fontWeightnumber or stringSets font size based on the typographic scale
heightnumber, string, or arraySets height
italicbooleanSets styles for italic type treatments
maxHeightnumber, string, or arraySets max-height
maxWidthnumber, string, or arraySets max-width
minHeightnumber, string, or arraySets min-height
minWidthnumber, string, or arraySets min-width
mnumber, string, or arraySets margin based on the theme.space scale
mbnumber, string, or arraySets margin-bottom
mlnumber, string, or arraySets margin-left
mrnumber, string, or arraySets margin-right
mtnumber, string, or arraySets margin-top
mxnumber, string, or arraySets margin-left and margin-right
mynumber, string, or arraySets margin-top and margin-bottom
overflowstringSets the ccs overflow value
overflowXstringSets the ccs overflowX value
overflowYstringSets the ccs overflowY value
pnumber, string, or arraySets padding based on the theme.space scale
pbnumber, string, or arraySets padding-bottom
plnumber, string, or arraySets padding-left
prnumber, string, or arraySets padding-right
ptnumber, string, or arraySets padding-top
pxnumber, string, or arraySets padding-left and padding-right
regularbooleanSets font-weight: props.theme.regular
textAlignstring, arraySets the text-align property
widthnumber, string, or arraySets the width of the element