Text
Display text with standardized typography styles
The Text component displays text content with predefined typography variants.
variant is the published vocabulary of TextSchema and the renderer maps every
value in it: h1-h6 render the heading element they name, body, caption and
overline render an inline span. Any other spelling is refused by the validator
rather than ignored.
Basic Usage
Simple Text
Variants
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Paragraph
Caption
Schema
interface TextSchema {
type: 'text';
content: string; // Text content to display — the one spelling
variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body' | 'caption' | 'overline';
align?: 'left' | 'center' | 'right' | 'justify';
className?: string; // Additional CSS classes
}Retired:
value(objectui#6951, ADR-0049 enforce-or-remove).valuewas a second spelling of the one content slot — the renderer read it only as the fallback ofcontent || value— and it is no longer part ofTextSchemaon either face. Atextnode that authorsvaluenow fails validation with:RETIRED (objectui#6951) —
valueis no longer part of TextSchema; writecontent. …Rename the key to
content; the string is unchanged. Measured before the retirement: 776content-onlytextnodes against 25value-only acrossexamples/,apps/,packages/*/examplesandcontent/docs/**.
Examples
Colored Text
Colour is className, not a key of its own. TextSchema publishes no color,
and the renderer builds the element's class list from variant, align and
className alone — so the three tiles below author
"className": "text-primary", "text-destructive" and
"text-muted-foreground" on the text nodes themselves.
⚠️ This page taught a color key until objectui#7444. Nothing ever declared or
read it: BaseSchema is .passthrough(), so an authored color is still
accepted today and still does nothing — it does not even reach the element,
because color is not on the DOM pass-through whitelist. Rename the key to
className; the Tailwind class string is unchanged.