API and Development
CoreText 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.BodyBase | Typography variant. Options: Display, Heading, Subheading, Title, NumericDisplay, NumericCompact, BodyLarge, BodyBase, BodySmall, Label, Button, Overline, Caption, MonoMedium, MonoSmall. |
animation | Opt-in odometer. Requires a numeric value. Heading types are excluded. | |
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 | TextColor.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. |
Use for standard body text with default styling.
Use heading types for page titles, section headers, and hierarchical content structure. Each maps to a default semantic heading tag (h1–h4).
Use for the primary page title or main heading.
Use for major section headings.
Use for subsection headings.
Use for minor headings or content labels.
Non-heading 2.4rem type mapped to --text-heading. Use for metric values that must stay a span. Pair with strong for weight 600.
Non-heading 1.8rem type mapped to --text-subheading. Use for dense standalone numeric displays that must stay a span; MetricCard always uses NumericDisplay.
The reel renders every internal with the root’s text type, weight, and color. Static and animated text therefore use identical font-size, family, line-height, letter-spacing, and glyph metrics at BodySmall, NumericCompact, and NumericDisplay.
Use 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).
Use different text sizes to establish visual hierarchy.
Use for emphasized body text or introductory content.
Use for standard body text and paragraphs.
Use for secondary information, captions, or fine print.
Use for eyebrows, labels, or distinctive uppercase-style text. Overline applies uppercase styling by default; you can override with transform.
Use for form field labels and compact UI labels (medium weight by default).
Use for text that matches button typography (bold weight by default).
Use for supporting or secondary one-line text.
Use for monospace content at the medium scale (e.g. code snippets, IDs).
Use for compact monospace (e.g. inline tokens, metadata).
Use color variants to convey meaning or establish visual hierarchy.
Use semantic colors to communicate meaning or status.
Use base color variants for standard text hierarchy.
Control text alignment for layout purposes.
Apply different font weights for emphasis or hierarchy.
Use for strong emphasis or important information.
Use for subtle emphasis without full bold weight.
Apply text transformations for stylistic purposes.
Truncate text that overflows its container with an ellipsis.
When text is truncated, a title attribute is automatically added with the full text content for accessibility.
Prevent text from wrapping to multiple lines.
Combine multiple properties for complex text styling.
Embed interactive elements within text content.
Use the formatMessageProps prop for internationalized text with embedded formatting.
The Trans component handles interpolation and formatting of internationalized content while preserving embedded React components.
Use headings in a proper semantic hierarchy.
Display error messages with appropriate styling.
Display success messages with appropriate styling.
Use text components for form labels and help text.
On this page