Skip to content
Mosaic
On this page

Text

Themeable body copy with size and color variants. Renders a p, or the render element. Defaults can come from TextContext.

Use for

  • body copy or a paragraph
  • secondary or muted text
  • inline copy inside other text, with render

Practices

GuidancePractice
DoPass render={<span />} for inline copy.
DoUse color='foreground-secondary' for muted copy instead of an xstyle color.

API reference

Text

Renders a p and forwards its ref. Carries data-size and data-color.

Slot: cl-text

PropTypeDescription
sizeTypographySizexs, sm, base, lg, xl or 2xl.Default: 'sm'
colorTypographyColorforeground, foreground-secondary, brand, warning, negative or positive.Default: 'foreground'

Examples

Body copy

TSX
<Text>{description}</Text>

Inline muted copy

TSX
<Text render={<span />} color='foreground-secondary'>{email}</Text>