Text
The text primitive. Authored single-run reading text in the body voice, on p, span and div, on the captions legend, figcaption and label, and on h1–h6 when the outline needs a heading that reads like text. The family litmus: do you author the element? Text for reading, Caption for the UI voices, Heading for the loud ones. A flow you don't control? Prose.
Sizes
The body voice has three steps, md by default. Unlike Heading, the element never decides the size.
Size lg — a lead paragraph, a standfirst under a heading
Size md — the default; the everyday reading size
Size sm — a footnote, a byline, a timestamp
---
import Text from "tsugite/Text/Text.astro";
---
{/* The body voice has three steps. md is the default; the element never
decides the size here — a p, span or div all start at md. */}
<Text text="Size lg — a lead paragraph, a standfirst under a heading" size="lg" />
<Text text="Size md — the default; the everyday reading size" />
<Text text="Size sm — a footnote, a byline, a timestamp" size="sm" />Block and inline
The element is the markup shape, the voice is the look, and inline is the intent. A Text is a block that owns its box and trim on whatever element it stands; inline puts it in its host's line — a span by default, label allowed — with no trim and no reading ceiling (ADR-0024).
A p — a block, owns its trim
A span is a block too, the same metricsA line with an inline Text flowing on it.
---
import Text from "tsugite/Text/Text.astro";
---
{/* The element is the markup shape, the voice is the look, and inline is the
intent (ADR-0024): a block Text owns its box and its trim on any element,
a span included; an inline Text flows on its host's line, a span unless it
says label, and leaves trim to the host. */}
<Text text="A p — a block, owns its trim" element="p" />
<Text text="A span is a block too, the same metrics" element="span" />
<Text element="p">
A line with <Text text="an inline Text" inline /> flowing on it.
</Text>Body on a heading shape
A heading that should read like text. The element is the outline's business, the voice the design's; the two never force each other. The quiet voice keeps its emphasis law here — strong stays bold — where Heading would flatten it, which is why this cell is Text's and not Heading's (ADR-0023).
A body-voiced h3, size lg
A body-voiced h4, size md
A body-voiced h5, size sm, with strong kept
---
import Text from "tsugite/Text/Text.astro";
---
{/* A heading that should read like text: the body voice on a heading shape. The
outline gets its h-element, the words keep the quiet voice and its emphasis
law — <strong> stays bold here, where Heading would flatten it. */}
<Text text="A body-voiced h3, size lg" element="h3" size="lg" />
<Text text="A body-voiced h4, size md" element="h4" />
<Text element="h5" size="sm">A body-voiced h5, size sm, with <strong>strong</strong> kept</Text>Emphasis keeps its semantics
Child content runs through the same engine as prop text. In the body voice strong takes the body-bold weight and em stays italic — the loud voices flatten instead (ADR-0012, law b).
Found a mistake? Let us know, and we will fix it.
---
import Text from "tsugite/Text/Text.astro";
---
{/* Child content passes through the same engine as prop text (law a). In
the quiet voices emphasis KEEPS its semantics (law b): strong takes the
body-bold weight, em stays italic. The loud voices flatten instead —
compare /docs/heading. */}
<Text size="lg">
<strong>Found a mistake?</strong> Let us know, and we <em>will</em> fix it.
</Text>Two voices on one line
A Caption in the label voice as an inline run at the start of a body-voiced block. Each run resolves its own bundle; the line negotiates the baseline.
Found a mistake? Let us know.
---
import Text from "tsugite/Text/Text.astro";
import Caption from "tsugite/Caption/Caption.astro";
---
{/* Two voices on one line: a body-voiced block host with a label-voiced
inline run (Caption) at its start. Each run resolves its own bundle; the line
negotiates the baseline. */}
<Text element="p" voice="body" size="lg">
<Caption inline size="lg" text="Found a mistake?" /> Let us know.
</Text>Voice sovereignty
An unvoiced span inherits the run's metrics; a voiced child owns its own bundle. Nearest voice wins by inheritance, never by specificity (ADR-0012, law d).
An unvoiced span inherits the run; a voiced child owns its own bundle.
---
import Text from "tsugite/Text/Text.astro";
import Caption from "tsugite/Caption/Caption.astro";
---
{/* Law (d): an UNVOICED inline element inherits the run's metrics; a
VOICED child (data-voice) owns its own bundle. Nearest voice wins by
inheritance, never by specificity. */}
<Text element="p" voice="body">
An unvoiced <span>span inherits the run</span>; a voiced child
<Caption inline text=" owns its own bundle" />.
</Text>Alignment and wrapping
align-inline sets the inline alignment with logical values, start | center | end; wrap chooses the line-breaking strategy — pretty by default, where Heading defaults to balance.
Centered, and set to balance so the two lines come out even when the space runs out
Right-aligned, wrapping pretty by default, so no single word is left on the last line
Never wraps — nowrap lets the line overflow instead of breaking
---
import Text from "tsugite/Text/Text.astro";
---
{/* align: left | center | right. wrap: pretty (default) | balance | stable | nowrap.
Text defaults to pretty — no orphan word ends a paragraph — where
Heading defaults to balance. */}
<Text text="Centered, and set to balance so the two lines come out even when the space runs out" alignInline="center" wrap="balance" />
<Text text="Right-aligned, wrapping pretty by default, so no single word is left on the last line" alignInline="end" />
<Text text="Never wraps — nowrap lets the line overflow instead of breaking" wrap="nowrap" />Line length
A paragraph is capped at the body stop's line length, on by default (ADR-0021). The ceiling is in ch, so it steps with the size; capInline={false} releases it.
Seventy characters is a reading measure: long enough for a sentence to breathe, short enough for the eye to find the next line without hunting. This paragraph stops there however wide the column is.
The small stop is capped at its own length, sixty-four of its smaller characters, so it ends up narrower in pixels than the paragraph above.
With the ceiling off the paragraph runs the whole column, which is what every Text did before the line length existed. The docs pages you read this on were set this way.
---
import Text from "tsugite/Text/Text.astro";
---
{/* A paragraph is capped at the body stop's line length (70ch at md), on by default; the ceiling
steps with the size because a ch is measured in the run's own face. capInline={false} releases it. */}
<Text text="Seventy characters is a reading measure: long enough for a sentence to breathe, short enough for the eye to find the next line without hunting. This paragraph stops there however wide the column is." />
<Text size="sm" text="The small stop is capped at its own length, sixty-four of its smaller characters, so it ends up narrower in pixels than the paragraph above." />
<Text capInline={false} text="With the ceiling off the paragraph runs the whole column, which is what every Text did before the line length existed. The docs pages you read this on were set this way." />Test bench
The Text fixture — the run engine laws and every size × element the body voice allows, mounted unchanged.
Text
Authored single-run reading text. Text owns the body voice; Caption owns the UI voices (label, button); Heading owns the loud ones. The litmus: do you author the element? → family component. A flow you don't control? → Prose.
runs and chaining (the run engine laws)
One voice + inline emphasis · two voices chained on one line (a block host and an inline run) · voice sovereignty (an unvoiced span inherits, a voiced child owns its bundle).
| inline emphasis | Upptäckt ett fel? Kontakta oss. |
|---|---|
| two-voice chain | Upptäckt ett fel? Kontakta oss. |
| sovereignty | An unvoiced span inherits the run; a voiced child owns its own bundle. |
voice: body
the body bundle — Noto Serif · p / span / div / legend / figcaption / label · size lg–sm
| p | span | div | legend | figcaption | label | h1 | h2 | h3 | h4 | h5 | h6 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| size lg | body lg | body lg | body lg | body lg | body lg | body lg | body lg | body lg | body lg | |||
| size md | body md | body md | body md | body md | body md | body md | body md | body md | body md | |||
| size sm | body sm | body sm | body sm | body sm | body sm | body sm | body sm | body sm | body sm |