Caption
The UI voices of the typography family: label marks the interface up — form labels, legends, figcaptions, table headers, hints; button is the pressable voice; nav is the wayfinding voice. The controls read their voice as tokens; this door speaks every UI voice standalone, so the door is total. Three sibling voices, one door, like Heading with heading and display, on whatever element the semantics need.
Three voices, three steps
label, button and nav are siblings that share a door, not a voice and its variants. In this theme they carry the same values — Inter 400 — on purpose: same value, separate knob, so a brand can turn one without the others.
Label lg — a field group's title
Label md — a form label, a table header
Label sm — a hint, a helper line under a field
Button lg — the pressable voice, standalone
Button md — same tokens Button.css reads
Button sm
Nav lg — the wayfinding voice, standalone
Nav md — what the navigation items read
Nav sm
---
import Caption from "tsugite/Caption/Caption.astro";
---
{/* Three UI voices, three steps each. label marks the interface up; button is the
pressable voice; nav is the wayfinding voice. The controls read them as tokens —
here they speak standalone. Same values in this theme, separate knobs. */}
<Caption element="p" text="Label lg — a field group's title" size="lg" />
<Caption element="p" text="Label md — a form label, a table header" />
<Caption element="p" text="Label sm — a hint, a helper line under a field" size="sm" />
<Caption element="p" voice="button" text="Button lg — the pressable voice, standalone" size="lg" />
<Caption element="p" voice="button" text="Button md — same tokens Button.css reads" />
<Caption element="p" voice="button" text="Button sm" size="sm" />
<Caption element="p" voice="nav" text="Nav lg — the wayfinding voice, standalone" size="lg" />
<Caption element="p" voice="nav" text="Nav md — what the navigation items read" />
<Caption element="p" voice="nav" text="Nav sm" size="sm" />The element is the semantics
Whatever the markup needs: a legend that is a heading, a label that is a label, a figcaption. Nested fieldsets in a wizard bind their groups with legends at every level, and each looks like what the design wants — the voice never forces the element, the element never forces the voice. The farm is the whole family's for exactly this reason.
---
import Caption from "tsugite/Caption/Caption.astro";
---
{/* The element is the semantics, the voice is the look, and the two never force each
other. A wizard's nested fieldsets bind their groups with legends: the outer one is
a heading semantically and looks like a label; the inner one is a legend that looks
like a large label; the fields carry real <label> elements. A figcaption speaks the
same voice on the element a caption is. */}
{/* The field styling is not the point and is not the family's; the gaps are tokens. */}
<fieldset style="display: grid; gap: var(--size-sm); padding: var(--size-md);">
<Caption element="h3" text="Contact details" />
<div style="display: grid; gap: var(--size-xs);">
<Caption element="label" size="sm" text="Email" for="elements-email" />
<input id="elements-email" type="email" />
</div>
<fieldset style="display: grid; gap: var(--size-sm); padding: var(--size-md);">
<Caption element="legend" size="lg" text="Delivery address" />
<div style="display: grid; gap: var(--size-xs);">
<Caption element="label" text="Street" for="elements-street" />
<input id="elements-street" type="text" />
</div>
</fieldset>
</fieldset>
<figure>
<Caption element="figcaption" size="sm" text="Figure 1 — a caption in the label voice." />
</figure>Emphasis: a door, not a law
strong asks for the voice's bold weight with one fallback to the voice's own. This theme gives the UI voices one weight, so emphasis renders flat here — by value, not by law. A theme that adds a bold weight to the voice opens the door without a line of CSS changing. em stays italic.
A required field, with an optional note.
---
import Caption from "tsugite/Caption/Caption.astro";
---
{/* The emphasis door is open, not closed: strong asks for the voice's bold weight with
one fallback to the voice's own. This theme gives label one weight (Inter 400), so
the strong below renders flat — by value, not by law. A theme that adds a bold weight
to the voice opens the door without a line of CSS changing. em stays italic. */}
<Caption element="p">A <strong>required</strong> field, with an <em>optional</em> note.</Caption>Test bench
The Caption fixture — every voice × size × element, and the button voice beside a Button, mounted unchanged.
Caption
The UI voices: label marks the interface up — labels, legends, figcaptions, table headers, hints; button is the pressable voice; nav is the wayfinding voice. The controls read their voice as tokens; this door speaks every UI voice standalone. Three sibling voices, one door, on whatever element the semantics need.
voice: label
the label bundle · label / legend / figcaption / p / span / div / h3 · size lg–sm
| label | legend | figcaption | p | span | div | h3 | |
|---|---|---|---|---|---|---|---|
| size lg | label lg | label lg | label lg | label lg | |||
| size md | label md | label md | label md | label md | |||
| size sm | label sm | label sm | label sm | label sm |
voice: button
the button bundle · label / legend / figcaption / p / span / div / h3 · size lg–sm
| label | legend | figcaption | p | span | div | h3 | |
|---|---|---|---|---|---|---|---|
| size lg | button lg | button lg | button lg | button lg | |||
| size md | button md | button md | button md | button md | |||
| size sm | button sm | button sm | button sm | button sm |
voice: nav
the nav bundle · label / legend / figcaption / p / span / div / h3 · size lg–sm
| label | legend | figcaption | p | span | div | h3 | |
|---|---|---|---|---|---|---|---|
| size lg | nav lg | nav lg | nav lg | nav lg | |||
| size md | nav md | nav md | nav md | nav md | |||
| size sm | nav sm | nav sm | nav sm | nav sm |
the button voice, beside the Button
Same tokens, two consumers: the words of a Button and a standalone run in the button voice sit on one line.
| size lg | — the button voice, standalone |
|---|---|
| size md | — the button voice, standalone |
| size sm | — the button voice, standalone |