Skip to main content

Text

The Text component displays text with specific visual styles or tones. Use it to present content with appropriate emphasis, hierarchy, or tone while maintaining semantic meaning.

Text on mobile surfaces is blockish, rather than inline.

Use cases

  • Body content: Display text, labels, and descriptions with appropriate visual hierarchy.
  • Status information: Present alerts or notifications using tone to convey urgency or importance.
  • Emphasis: Create emphasized text elements using type variations like strong or small.
  • Nested content: Support nested text elements for complex formatting within a single block.

Display text content using a Text component with customizable visual styles and tones. This example shows basic text with appropriate emphasis and hierarchy.

Display text with visual styles

Display text with visual styles

<s-text>
<s-text type="strong">Name:</s-text> Jane Doe
</s-text>

Configure the following properties on the Text component.

Anchor to color
color
Default: 'base'

Modify the color to be more or less intense.

string

A unique identifier for the element.

"auto" | "neutral" | "info" | "success" | "caution" | "warning" | "critical"
Default: 'auto'

Sets the tone of the component, based on the intention of the information being conveyed.

"strong" | "small" | "generic"
Default: 'generic'

Provide semantic meaning and default styling to the text.

Other presentation properties on Text override the default styling.

  • Choose semantic types: Use strong for emphasis, small for secondary info, generic for standard text.
  • Apply appropriate tones: Use success for positive outcomes, warning or critical for alerts, info for helpful context, auto for neutral content.
  • Balance color intensity: Use strong for emphasis, base for readability, subdued for secondary info.
  • Nest for mixed formatting: Nest Text components when you need multiple styles within one text block.
  • Use Stack for icons and badges: When combining text with icons or badges, use Stack with direction="inline" instead of nesting components inside Text.

Complex rich text formatting isn't supported—use multiple Text components or nested text elements for varied formatting needs.

Nesting Icon or Badge components inside Text isn't supported due to React Native alignment limitations—use Stack with direction="inline" and alignItems="center" instead to properly align icons and badges with text.

Was this page helpful?