Text

The Text component is used to display content on your page.

A man looks at a painting in a museum and says, “Brothers and sisters I have none, but that man's father is my father's son.” Who is in the painting?

API reference

PropTypeDefaultResponsive
variant
displaytitle1title2title3title4title5
-Yes
weight
regularbold
-Yes
children
ReactNode
-No
className
string
-No
style
CSSProperties
-No

Examples

All variants

The Text component has a variant prop that can be used to change the appearance of the text.

A man looks at a painting in a museum and says, “Brothers and sisters I have none, but that man's father is my father's son.” Who is in the painting?

A man looks at a painting in a museum and says, “Brothers and sisters I have none, but that man's father is my father's son.” Who is in the painting?

A man looks at a painting in a museum and says, “Brothers and sisters I have none, but that man's father is my father's son.” Who is in the painting?

A man looks at a painting in a museum and says, “Brothers and sisters I have none, but that man's father is my father's son.” Who is in the painting?

<Flex direction="column" gap="4">
  <Text variant="subtitle" style={{ maxWidth: '600px' }}>
    A man looks at a painting in a museum and says, “Brothers and sisters I
    have none, but that man&apos;s father is my father&apos;s son.” Who is
    in the painting?
  </Text>
  <Text variant="body" style={{ maxWidth: '600px' }}>
    A man looks at a painting in a museum and says, “Brothers and sisters I
    have none, but that man&apos;s father is my father&apos;s son.” Who is
    in the painting?
  </Text>
  <Text variant="caption" style={{ maxWidth: '600px' }}>
    A man looks at a painting in a museum and says, “Brothers and sisters I
    have none, but that man&apos;s father is my father&apos;s son.” Who is
    in the painting?
  </Text>
  <Text variant="label" style={{ maxWidth: '600px' }}>
    A man looks at a painting in a museum and says, “Brothers and sisters I
    have none, but that man&apos;s father is my father&apos;s son.” Who is
    in the painting?
  </Text>
</Flex>

All weights

The Text component has a weight prop that can be used to change the appearance of the text.

A man looks at a painting in a museum and says, “Brothers and sisters I have none, but that man's father is my father's son.” Who is in the painting?

A man looks at a painting in a museum and says, “Brothers and sisters I have none, but that man's father is my father's son.” Who is in the painting?

<Flex direction="column" gap="4">
  <Text weight="regular" style={{ maxWidth: '600px' }}>
    A man looks at a painting in a museum and says, “Brothers and sisters I
    have none, but that man&apos;s father is my father&apos;s son.” Who is
    in the painting?
  </Text>
  <Text weight="bold" style={{ maxWidth: '600px' }}>
    A man looks at a painting in a museum and says, “Brothers and sisters I
    have none, but that man&apos;s father is my father&apos;s son.” Who is
    in the painting?
  </Text>
</Flex>

Responsive

You can also use the variant prop to change the appearance of the text based on the screen size.

<Text variant={{ initial: 'body', lg: 'subtitle' }}>
  Responsive text
</Text>