Products · Components

Text

Text, from a large amount or a title down to a caption.

Use one Text for each line or paragraph. To style part of a line, put a Text inside another.

Children: Text, which can include Text, Link and Icon within a line · Inline: can sit within a line of text, inside a Text

Example

The Text component
view.dml
<View gap="small">
  <Text variant="title">Your balance</Text>
  <Text variant="display" numeric>SLE 1,250.00</Text>
  <Text tone="muted">Updated a minute ago</Text>
</View>

Props

PropTypeWhat it is
variantdisplay, title, subtitle, lead, body, captiondisplay is for large amounts, such as a balance. lead is an article's opening paragraph. Default: body.
tonetext tone, or a custom color
weightregular, medium, bold
alignstart, center, end
maxLinesnumberCuts the text off with an ellipsis after this many lines.
decorationnone, underline, strikethroughstrikethrough shows a price that no longer applies.
numericbooleanGives every digit the same width, so amounts line up in a list.
leadingtight, normal, relaxedThe space between lines, closer or wider than the variant's own.
italicboolean
selectablebooleanLets the person select the text and copy it, such as a passage of an article.
padding, paddingTop, paddingStart, paddingEnd, paddingBottomspacingSpace inside its edges, all round or on one side.

Events

None.

Keep reading

On this page