API and Development
Text displays text content with consistent typography, supporting headings, body text, and styled variations for various contexts throughout the interface. It provides a unified typography system supporting display and section titles, body ladder, labels, overlines, monospace variants, and flexible formatting options. Built on Radix UI's Text and Heading components, it ensures consistent typography across the interface with full accessibility support, internationalization, and responsive behavior.
| Name | Default | Description |
|---|---|---|
type | TextType.BodyLarge | Typography variant. Options: Display, Heading, Subheading, Title, NumericDisplay, NumericCompact, BodyLarge, BodyBase, BodySmall, Label, Button, Overline, Caption, MonoMedium, MonoSmall. |
headingLevel | Overrides the default heading element for the type (e.g. HeadingLevel.H2 while keeping Display styling). When set, renders a Radix Heading with that tag. | |
color | Foreground.Base | The text color variant. Options: Base, Alt, Alt2, Disabled, Info, Accent, Success, Warning, Error, Inverted. |
align | TextAlign.Left | Text alignment. Options: Left, Center, Right. |
transform | TextTransform.None | Text transformation to apply. Options: None, Uppercase, Lowercase, Capitalize. Overline defaults to Uppercase when transform is None. |
strong | false | Whether to apply bold font weight. |
medium | false | Whether to apply medium font weight. |
truncate | false | Whether to truncate text with ellipsis when it overflows its container. |
noWrap | false | Whether to prevent text from wrapping to multiple lines. |
asSpan | false | When true, renders as a span instead of a block element (e.g. p). Use for inline text; prefer block elements for standalone paragraphs. |
formatMessageProps | Props for internationalization using the Trans component. Requires i18nKey property. | |
children | required | The text content to display. Can be a string, React node, or formatted content. |
h1–h4).
Use for the primary page title or main heading.
--text-heading. Use for metric values that must stay a span. Pair with strong for weight 600.
--text-subheading. Use for dense standalone numeric displays that must stay a span; MetricCard always uses NumericDisplay.
headingLevel when the visual style should stay on one scale but the semantic tag must differ (for example, a page title that should be h2 for document order).
transform.
title attribute is automatically added with the full text content for accessibility.
Prevent text from wrapping to multiple lines.
formatMessageProps prop for internationalized text with embedded formatting.
Trans component handles interpolation and formatting of internationalized content while preserving embedded React components.
Use headings in a proper semantic hierarchy.