Usage
formatMessageProps.| Role / type | Purpose | Emphasis |
|---|---|---|
| Display / Heading / Subheading / Title | Section hierarchy | One Display per view or major region; don’t skip levels |
| NumericDisplay / NumericCompact | Large numbers that must stay a span | 2.4rem and 1.8rem. MetricCard always uses NumericDisplay |
| BodyLarge / BodyBase / BodySmall | Body ladder | BodySmall for secondary metadata, not for primary instructions alone |
| Label / Button | Compact UI and action-aligned copy | Label for field labels; Button for text that matches button typography |
| Overline | Eyebrows or badges | Use sparingly; test readability |
| Caption | Supporting one-line text | Secondary context without competing with body |
| MonoMedium / MonoSmall | Monospace literals | IDs, code, tokens; pick scale by density |
| Semantic colors | Status and tone | Pair with icons or text for color-blind users |
Text renders semantic elements (h1–h4 for display heading types, p or span for body and other types) with token-driven styling. NumericDisplay and NumericCompact stay spans at heading sizes so a metric value is never an h*. Alignment, truncation, no-wrap, and transformation props adjust layout but should not fight the content’s natural reading pattern.
Pass value to Text from @prepared911/ui/text. type selects the text style. Digits roll to each new value. from is the number shown on first paint. roll={false} renders the formatted number as plain text. announcement is localized copy spoken after the roll settles, not on first paint.
formatMessage; plan for expansion in German and Romance languages.onClick on plain text.Success, Warning, Error) consistently with product meaning.h* vs p).formatMessage fragments must remain keyboard accessible when they include links or buttons.