Organism · stable · v1.0.0 · owner: Site system lead · contract 19 of 20 points (open: figma)
Do and don't
Do: Switch
Rendered by token-chain.tsOpen example: Token chain · Do: Switch Use the full-page example to follow page links.
Do: Button
Rendered by token-chain.tsOpen example: Token chain · Do: Button Use the full-page example to follow page links.
Don't: Invented tokens
Rendered by token-chain.tsOpen example: Token chain · Don't: Invented tokens Use the full-page example to follow page links.
Don't: Without the value
Rendered by token-chain.tsOpen example: Token chain · Don't: Without the value Use the full-page example to follow page links.
Rules
| Rule | Why | Check |
|---|---|---|
| The token chain is drawn from Loom Base contracts and tokens (packages/base) at build time. | A figure read from the real records cannot drift from them. | Automated: npm run site:build (reads the data; fails if it is missing) |
| Chains are resolved from Loom Base at build time. | They cannot drift from the tokens. | Automated: npm run site:build |
API
| Prop | Type | Required | Default | What it does |
|---|---|---|---|---|
id | string | No | "switch" | The Loom Base contract id. |
Contract details
The full contract: identity, anatomy, variants, states, tokens, layout, motion, accessibility, content, tests
Identity
| Aspect | Value |
|---|---|
| Id | token-chain |
| Layer | Organisms |
| Category | figure |
| Owner | Site system lead |
| Status | stable |
| Version | 1.0.0 |
| Source | apps/showcase/site/system/organisms/token-chain.ts (private repository; the contract and the render function are this one module) |
| Version | Date | Change |
|---|---|---|
| 1.0.0 | 2026-10-26 | Token chain, drawn at build time from Loom Base contracts and tokens (packages/base). |
Use when
- Shape and Loom Base pages, inside the contract excerpt. Why: The chain makes 'typed tokens' concrete.
Do not use when
- For a client's tokens. Why: Loom Base's, which are public.
Anatomy
| Part | What it is |
|---|---|
| root | div.cx-chain inside the contract excerpt |
| tiers | span.cx-tier (component, semantic, primitive) |
| value | span.cx-val |
Made of: figure-frame, code-block, tag, caption.
Used in: contract-excerpt.
Variants
| Variant | When | Why |
|---|---|---|
| default | Wherever its claim is made. | One drawing per claim keeps the evidence consistent. |
States
| State | Rendered or not applicable |
|---|---|
| default | default |
| hover | Not applicable: The token chain is not interactive, so it has no hover state. |
| focus-visible | Not applicable: The token chain does not take focus; links and buttons inside it carry their own focus ring. |
| active | Not applicable: The token chain cannot be pressed. |
| disabled | Not applicable: The token chain has nothing to disable. |
| loading | Not applicable: The token chain is rendered at build time and is complete when the page loads. |
| empty | Not applicable: The token chain is not rendered without content; the builder skips it. |
| error | Not applicable: The token chain shows no data that can fail. |
| current | Not applicable: The token chain has no current item. |
| visited | Not applicable: The token chain is not a link. |
| expanded | Not applicable: The token chain does not open or close. |
Tokens
| Part | Token |
|---|---|
| tier.font | --font-mono |
| value.swatch | The resolved colour as a small mark with its hex |
| --token-chain-gap-space-6 | var(--space-6) |
| --token-chain-gap-space-9 | var(--space-9) |
| --token-chain-margin-space-7 | var(--space-7) |
| --token-chain-font-size-fs-small | var(--fs-small) |
| --token-chain-margin-space-2 | var(--space-2) |
| --token-chain-padding-left-space-7 | var(--space-7) |
| --token-chain-padding-bottom-space-4 | var(--space-4) |
| --token-chain-font-size-fs-label | var(--fs-label) |
| --token-chain-color-ink-2 | var(--ink-2) |
| --token-chain-margin-right-space-4 | var(--space-4) |
| --token-chain-border-line | var(--line) |
Layout
| Aspect | Value |
|---|---|
| breakpoints | Required review at 390, 768, 1024 and 1440 px; execution is not implied by this declaration; the figure reflows to one column under 768 px. |
| wrapping | Labels wrap; drawings scale to the column. |
| textExpansion | Japanese labels are 20 to 40% longer and wrap inside their cells. |
Spacing and rhythm
| Aspect | Value |
|---|---|
| internal | Inside the Figure frame's --space-7 padding. |
| external | --space-9 above and below in prose. |
| rhythm | After the text whose claim it proves. |
Motion
| Aspect | Value |
|---|---|
| None | A record is evidence: it holds still so it can be read. |
Runtime and reuse
Render-only element; mount any registered child enhancements separately. Preserve required Site CSS, fonts, responsive and locale rules from nativeElement.
Accessibility passport
| Aspect | Value |
|---|---|
| role | figure, named by its caption |
| name | The caption, and a text alternative for any drawing |
| keyboard | Not interactive unless stated. |
| focus | Links inside are in reading order. |
| screenReader | Reads the figure's text and caption; drawings have role=img with a description. |
| contrast | Ink on surface 14:1; dyes used only as marks with their words. |
| target | Not a target. |
Content
| Slot | Length | Voice |
|---|---|---|
| tier | 1 token path | As in Loom Base |
Good: “color.action.background → color.palette.dye-indigo.800 → #1e2a78”
Bad: “blue”
Japanese: Token paths stay English.
Icons and illustrations
None: this element uses no icon or illustration of its own.
Decisions and exceptions
Usage
16 uses across the built pages (measured by npm run site:system).
Tests
| Aspect | Value |
|---|---|
| unit | tests/unit/site-system.test.ts: renders every do and don't example through the registry and checks the classes it owns |
| visual | Not yet: there are no screenshot baselines; the Library page is checked for sideways scroll at 1440 px by tests/site/system.spec.ts |
| a11y | tests/site/system.spec.ts: axe (0 serious or critical) on the element's Library page in light and dark |
| parity | scripts/site/system/check.ts: Library examples are rendered by the same render function the site imports |
Figma
not-yet: The Loom Site Figma library is the last stage of the plan; this element is not mapped yet.