Skip to Content
DocsEnterpriseBlogShowcase
Sponsor

Typography

JSX style props for styling text

Font Family

Use the fontFamily prop to set the font family of a text element.

<Text fontFamily="mono">Hello World</Text>
PropCSS PropertyToken Category
fontFamilyfont-familyfonts

Font Size

Use the fontSize prop to set the font size of a text element.

// hardcoded values
<Text fontSize="12px">Hello World</Text>
<Text fontSize="10rem">Hello World</Text>

// token values
<Text fontSize="xs">Hello World</Text>
<Text fontSize="4xl">Hello World</Text>
<Text fontSize="5xl">Hello World</Text>
PropCSS PropertyToken Category
fontSizefont-sizefonts

Text Styles

Use the textStyle prop to apply both a font size, line height, and letter spacing composition at once.

<Text textStyle="xs">Hello World</Text>
<Text textStyle="sm">Hello World</Text>
<Text textStyle="md">Hello World</Text>
<Text textStyle="lg">Hello World</Text>
<Text textStyle="xl">Hello World</Text>
<Text textStyle="2xl">Hello World</Text>
<Text textStyle="3xl">Hello World</Text>
<Text textStyle="4xl">Hello World</Text>
<Text textStyle="5xl">Hello World</Text>
PropConfig
textStyletheme.textStyles

Font Style

Use the fontStyle prop to set the font style of a text element.

<Text fontStyle="italic">Hello World</Text>
PropCSS PropertyToken Category
fontStylefont-stylenone

Font Weight

Use the fontWeight prop to set the font weight of a text element.

// hardcoded values
<Text fontWeight="600">Hello World</Text>

// token values
<Text fontWeight="semibold">Hello World</Text>
PropCSS PropertyToken Category
fontWeightfont-weightfontWeights

Font Variant Numeric

Use the fontVariantNumeric prop to set the font variant numeric of a text element.

<Text fontVariantNumeric="lining-nums">Hello World</Text>
PropCSS PropertyToken Category
fontVariantNumericfont-variant-numericnone

Letter Spacing

Use the letterSpacing prop to set the letter spacing of a text element.

// hardcoded values
<Text letterSpacing="0.1rem">Hello World</Text>

// token values
<Text letterSpacing="tight">Hello World</Text>
<Text letterSpacing="wide">Hello World</Text>
<Text letterSpacing="wider">Hello World</Text>
<Text letterSpacing="widest">Hello World</Text>
PropCSS PropertyToken Category
letterSpacingletter-spacingletterSpacings

Truncation

Use the truncate prop to truncate text.

<Text truncate>Lorem ipsum dolor sit amet...</Text>
PropCSS PropertyToken Category
truncatetext-overflownone

Line Clamp

Use the lineClamp prop to truncate multi-line text. Set lineClamp to none to disable truncation.

<Text lineClamp="2">Lorem ipsum dolor sit amet...</Text>

// revert truncation
<Text lineClamp="none">Lorem ipsum dolor sit amet...</Text>
PropCSS PropertyToken Category
lineClampwebkit-line-clampnone

Line Height

Use the lineHeight prop to set the line height of a text element.

// hardcoded values
<Text lineHeight="1.5">Hello World</Text>

// token values
<Text lineHeight="tall">Hello World</Text>
PropCSS PropertyToken Category
lineHeightline-heightlineHeights

Text Align

Use the textAlign prop to set the text alignment of a text element.

<Text textAlign="left">Hello World</Text>
<Text textAlign="center">Hello World</Text>
<Text textAlign="right">Hello World</Text>
<Text textAlign="justify">Hello World</Text>
PropCSS PropertyToken Category
textAligntext-alignnone

Text Color

Use the color prop to set the color of a text element.

<Text color="red">Hello World</Text>
PropCSS PropertyToken Category
colorcolorcolors

Text Decoration

Use the textDecoration or textDecor prop to set the text decoration of a text element.

<Text textDecoration="underline">Hello World</Text>
PropCSS PropertyToken Category
textDecor, textDecorationtext-decorationnone

Text Decoration Color

Use the textDecorationColor prop to set the text decoration color of a text element.

<Text textDecoration="underline" textDecorationColor="red">
  Hello World
</Text>
PropCSS PropertyToken Category
textDecorationColortext-decoration-colorcolors

Text Decoration Style

Use the textDecorationStyle prop to set the text decoration style of a text element.

<Text textDecoration="underline" textDecorationStyle="dashed">
  Hello World
</Text>
PropCSS PropertyToken Category
textDecorationStyletext-decoration-stylenone

Text Decoration Thickness

Use the textDecorationThickness prop to set the text decoration thickness of a text element.

<Text textDecoration="underline" textDecorationThickness="1px">
  Hello World
</Text>
PropCSS PropertyToken Category
textDecorationThicknesstext-decoration-thicknessnone

Text Underline Offset

Use the textUnderlineOffset prop to set the text underline offset of a text element.

<Text textDecoration="underline" textUnderlineOffset="1px">
  Hello World
</Text>
PropCSS PropertyToken Category
textUnderlineOffsettext-underline-offsetnone

Text Transform

Use the textTransform prop to set the text transform of a text element.

<Text textTransform="uppercase">Hello World</Text>
PropCSS PropertyToken Category
textTransformtext-transformnone

Text Overflow

Use the textOverflow prop to set the text overflow of a text element.

<Text textOverflow="ellipsis">Hello World</Text>
PropCSS PropertyToken Category
textOverflowtext-overflownone

Text Shadow

Use the textShadow prop to set the text shadow of a text element.

<Text textShadow="0 0 1px red">Hello World</Text>
PropCSS PropertyToken Category
textShadowtext-shadowshadows

Text Indent

Use the textIndent prop to set the text indent of a text element.

// hardcoded values
<Text textIndent="1rem">Hello World</Text>

// token values
<Text textIndent="3">Hello World</Text>
PropCSS PropertyToken Category
textIndenttext-indentspacing

Vertical Align

Use the verticalAlign prop to set the vertical alignment of a text element.

<Text verticalAlign="top">Hello World</Text>
PropCSS PropertyToken Category
verticalAlignvertical-alignnone

White Space

Use the whiteSpace prop to set the white space of a text element.

<Text whiteSpace="nowrap">Hello World</Text>
PropCSS PropertyToken Category
whiteSpacewhite-spacenone

Word Break

Use the wordBreak prop to set whether line breaks appear wherever the text would otherwise overflow its content box.

<Text wordBreak="break-all">Hello World</Text>
PropCSS PropertyToken Category
wordBreakword-breaknone

Hyphens

Use the hyphens prop to set whether hyphens are used in the text.

<Text hyphens="auto">Hello World</Text>
PropCSS PropertyToken Category
hyphenshyphensnone

Previous

Transitions

Next

Overview