Text
Use typography to present your design and content as clearly and efficiently as possible.
Text automatically resolves the HTML tag, weight, size and responsive
variations from the variant prop. It covers three groups: Block (running
text), Headline (headings) and Display (high-impact headings).
When to use
| ✅ Use when… | 🚫 Avoid when… |
|---|---|
|
|
Block
Simple Text
Simple Text
Simple Text
<Text variant="lead">Simple Text</Text>
<Text variant="p">Simple Text</Text>
<Text variant="meta">Simple Text</Text>Headline
H1 Headline
H2 Headline
H3 Headline
H4 Headline
H5 Headline
H6 Headline
<Text variant="h1">H1 Headline</Text>
<Text variant="h2">H2 Headline</Text>
<Text variant="h3">H3 Headline</Text>
<Text variant="h4">H4 Headline</Text>
<Text variant="h5">H5 Headline</Text>
<Text variant="h6">H6 Headline</Text>Display
H1 Display
H2 Display
H3 Display
H4 Display
<Text variant="d1">H1 Display</Text>
<Text variant="d2">H2 Display</Text>
<Text variant="d3">H3 Display</Text>
<Text variant="d4">H4 Display</Text>Forcing mobile / desktop
The Headline and Display variants have different styles on mobile and
desktop. To force one style to be displayed regardless of the screen, use the
type prop.
Headline auto
Headline Desktop
Headline Mobile
<Text variant="h2" text="Headline auto" />
<Text variant="h2" text="Headline Desktop" type="desktop" />
<Text variant="h2" text="Headline Mobile" type="mobile" />Typography props
The following Text props can be adjusted:
fontSizefontWeightlineHeightletterSpacingtextTransformtextDecorationfontStylealigncolor
<Text fontSize="nano" />
<Text fontWeight="bold" />
<Text lineHeight="wild" />
<Text letterSpacing="wild" />
<Text textTransform="captalyze" />
<Text fontStyle="code" />
<Text color="danger" />Live values (tick)
Pass the number behind a live cell as tick. On every change the ink snaps
to success (up) or danger (down) and eases back to the idle color over
theme.animation.transitions.settle (~2.75s). Only the color moves — no
layout shift, no wrapper. The first value is a baseline; equal values do
not flash. Users with prefers-reduced-motion get the snap without the
fade.
<Text variant="h3" tick={lastPrice} text={formatPrice(lastPrice)} />Use it for the number that changed, not for a column that stays green or
red as a standing tone — that is plain color.
Combining styles
Defaults from the theme
A bare <Text> (no fontWeight / color) reads theme.component.text —
the component tier — so a themer can set the default weight or ink
once instead of at every call site. Explicit props and the variant bundle
still win.
createTheme({ component: { text: { fontWeight: 'light', color: 'ink.secondary' } } });For the whole ladder (what light / regular / bold / stronger mean in
CSS numbers), use the brand-level typeWeight origin on createTheme /
ApollionProvider — see Theming, config-first.
Inline links inside a paragraph keep their own fontWeight — the prose
engine only underlines them.
Hello I am a
Text
<Text variant="h2">
Hello I am a{' '}
<Text as="span" color="grayscale.20" textDecoration="underline">
Text
</Text>
</Text>Links in prose (automatic underline)
Any Link inside a Text is automatically underlined by the
container — the one who knows the content is prose is the Text, so it is
the one asserting the rule. This keeps the link distinguishable by more than
color (WCAG 1.4.1), regardless of the link's own textDecoration.
Link.Button is left out and keeps its button appearance.
Read our privacy policy and the terms of use before proceeding.
Sign in<Text variant="p">
Read our <Link href="/privacidade" text="privacy policy" /> and the{' '}
<Link href="/termos" textDecoration="none" text="terms of use" /> before proceeding.{' '}
<Link.Button href="/entrar" text="Sign in" variant="contained" />
</Text>Tag attributes
The final tag and the set of accepted HTML attributes come from the same
rule the runtime uses: as when provided, otherwise the variant's tag,
otherwise span.
In practice the main path is the variant: variant="blockquote" renders
<blockquote> and accepts cite; variant="meta" renders <p> (the variant
declares the tag) and accepts what a <p> accepts. as is the one-off
override — as="time" unlocks dateTime, as="li" unlocks value — and
wins over the variant when both appear. Without as and without variant,
the global attributes of a <span> apply (id, title, aria-*, handlers).
variant | rendered tag | attributes beyond globals |
|---|---|---|
span (default), p, h1–h6 | itself | — |
blockquote | blockquote | cite |
meta, lead | p | — |
d1–d4 | h1–h4 | — |
This closes the blockquote variant case: the quote and the quote's source
can be declared together, with no cast and no redundant as at the call-site.
<figure>
<Text variant="blockquote" cite="https://example.com/materia">
Quoted excerpt from the external outlet
</Text>
<figcaption>
<Text variant="meta">
<cite>Outlet name</cite> —{' '}
<Text as="time" dateTime="2026-07-30">
30/07/2026
</Text>
</Text>
</figcaption>
</figure>Interactive Demo
loading
Properties
Prop | Type | Default | Description |
|---|---|---|---|
alignContent | "center" | "end" | "start" | "between" | "around" | "evenly" | "stretch" | — | Packing of wrapped lines / grid tracks on the block axis. |
as | ElementType<any, keyof IntrinsicElements> | — | Overrides the HTML tag resolved by the `variant` — the look of one,
the semantics of another. Also defines which HTML attributes apply.
@example ```tsx
<Text variant="h1" as="h2">Visually h1, semantically h2</Text>
``` |
color | string | — | Theme token (`theme.colors`) used as `color`. Has lower precedence than
`contrast`: when both are provided, the contrast calculation wins.
Stays `string` (not the typed union): `color` is also an HTML attribute
(`<li color>`, etc.) and interfaces extending native props require
identical types on the name collision. |
containment | string | — | Containment marker for the `cq` channel: emits
`container-type` (+ `container-name` when the string form carries one,
e.g. `'inline-size card'`). Apply on the immediate wrapper of the
adapting component — NEVER on page-level shells. |
cq | Partial<Record<ContainerSizeTypes, ContainerQueryable>> | — | Container-relative styles per `theme.containerSizes` key. |
enableBreakpoint | "xs" | "xl" | "sm" | "md" | "lg" | — | Forces a prop set to apply as if the given breakpoint were active,
regardless of the actual viewport size. Useful for stories/storyshots or
controlled previews. |
htmlFor | string | — | Forwarded to `htmlFor` when the final tag is a `<label>` (via
`as="label"`). Declared here — and not only via `as="label"` — to keep
the prop available when `Text` is used without a literal `as` (e.g.
`Partial<TextInterface>` in `labelProps`). |
ignoreResponsive | boolean | — | When `true`, fully disables the responsive factory (useful in tests or
in components that want to show a single fixed snapshot). |
justifyItems | "center" | "end" | "start" | "stretch" | — | Grid containers: inline alignment of every item in its cell. |
legibility | "on-photo" | — | Reading-shadow preset for text over a photographic background
(`on-photo`). Replaces the inline `style={{ textShadow }}` in the
consumer (brasil_2030 radar, gap A3). Token emission is deferred until a
2nd consumer asks for the raw var (see backlog). |
motion | "scale" | "none" | "fade" | "slide-up" | "slide-down" | "slide-left" | "slide-right" | "collapse" | "sheet" | "sheet-top" | "drawer-left" | "drawer-right" | — | Semantic motion preset. Enter animates on mount via
`@starting-style`; exit expects the `data-state="closing"` attribute
(see `useExitTransition`). Durations/easings resolve from the
`--apollion-motion-*` vars with the theme literal as fallback, so
`prefers-reduced-motion` zeroes them centrally.
@example ```tsx
<Flex motion="slide-up">Toast body</Flex>
``` |
pageShell | boolean | — | Centers the element and caps the width at `theme.layout.pageMaxWidth`.
The page shell of a classic centered layout. |
placeItems | "center" | "end" | "start" | "stretch" | — | Grid containers: `place-items` shorthand (block + inline). |
readable | number | boolean | — | Makes the `color` legible against the page surface: `true` = WCAG AA
(4.5), a number sets a custom floor. Ignored with `contrast`.
See the Layout Props concept page for the full semantics. |
text | string | — | Text to render. An alternative to `children` — when both are provided,
`children` takes precedence. |
tick | number | — | Live value driving a tick flash. When it changes, the glyph color snaps
to `success` (went up) or `danger` (went down) and then eases back to
the idle ink over `theme.animation.transitions.settle`. Only the color
moves — layout is untouched. Leave it unset for static text.
@example ```tsx
<Text tick={lastPrice} text={formatted} />
``` |
transform | string | — | CSS `transform` value (e.g. `translate(-50%, -33px)`). Never leaks
to the DOM as an attribute. |
type | "auto" | "mobile" | "desktop" | 'auto' | Responsive mode (see {@link TextType}). Use `'auto'` in most cases. |
variant | "blockquote" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "meta" | "p" | "span" | "lead" | "d1" | "d2" | "d3" | "d4" | span | Typographic variant. Determines tag, weight, size, and responsive
variations — and, consequently, which HTML attributes `Text` accepts
(see {@link TextInterface}). |
viewportMedias | Partial<Record<keyof BreakPoint<any>, ContainerQueryable>> | — | Viewport-driven styles per `theme.breakpoints` key, object grammar — the
viewport sibling of `cq` (see {@link ViewportMediaStyles}). |
Besides the props above, every component accepts the layout props (spacing, color, flex/grid, sizing, border) — not repeated here.
See also
- Storybook story: Components / Text
- Variant map:
variantStyleProps— extensible via custom themes.