Molecule · stable · v1.0.0 · owner: Site system lead · contract 19 of 20 points (open: figma)
Do and don't
Do: A labelled data table
Rendered by table.tsOpen example: Table · Do: A labelled data table Use the full-page example to follow page links.
Do: Two columns
Rendered by table.tsOpen example: Table · Do: Two columns Use the full-page example to follow page links.
Don't: No header cells
Rendered by table.tsOpen example: Table · Don't: No header cells Use the full-page example to follow page links.
Don't: Layout table
Rendered by table.tsOpen example: Table · Don't: Layout table Use the full-page example to follow page links.
Rules
| Rule | Why | Check |
|---|---|---|
| Tables have header cells with scope. | Assistive technology reads each cell with its header. | Automated: axe (tests/site/pages.spec.ts) |
| A table that can be wider than the screen sits in a focusable, labelled region. | The page never scrolls sideways, and keyboard users can still reach every column. | Automated: tests/site/pages.spec.ts (no horizontal scroll at 320 px) |
API
| Prop | Type | Required | Default | What it does |
|---|---|---|---|---|
label | string | Yes | The region's accessible name. | |
html | html | Yes | The table markup with header cells. |
Contract details
The full contract: identity, anatomy, variants, states, tokens, layout, motion, accessibility, content, tests
Identity
| Aspect | Value |
|---|---|
| Id | table |
| Layer | Molecules |
| Category | data |
| Owner | Site system lead |
| Status | stable |
| Version | 1.0.0 |
| Source | apps/showcase/site/system/molecules/table.ts (private repository; the contract and the render function are this one module) |
| Version | Date | Change |
|---|---|---|
| 1.0.0 | 2026-10-26 | Data tables in a focusable scroll wrapper. |
Use when
- Records with the same fields. Why: A table lets the reader compare down a column.
Do not use when
- For layout. Why: Layout tables confuse screen readers.
- For two or three facts. Why: A list reads faster.
Anatomy
| Part | What it is |
|---|---|
| root | div.table-wrap (focusable region, scrolls sideways) |
| table | table.table with th scope |
Made of: text, tokens:type.
Used in: cloth-diagram, contract-excerpt, coverage-map, layers-demo, repo-change, score-us, status-table, survey.
Variants
| Variant | When | Why |
|---|---|---|
| data | Records. | One style for every table. |
States
| State | Rendered or not applicable |
|---|---|
| default | default |
| hover | Not applicable: A table is not interactive, so it has no hover state. |
| focus-visible | The wrapper is focusable for keyboard scrolling and shows the focus ring. |
| active | Not applicable: A table cannot be pressed. |
| disabled | Not applicable: A table has nothing to disable. |
| loading | Not applicable: A table is rendered at build time and is complete when the page loads. |
| empty | Not applicable: A table is not rendered without content; the builder skips it. |
| error | Not applicable: A table shows no data that can fail. |
| current | Not applicable: A table has no current item. |
| visited | Not applicable: A table is not a link. |
| expanded | Not applicable: A table does not open or close. |
Tokens
| Part | Token |
|---|---|
| th.font | --type-small-strong |
| td.font | --type-small |
| row.border | --rule-hair --line |
| --table-font-type-small | var(--type-small) |
| --table-padding-space-4 | var(--space-4) |
| --table-padding-space-5 | var(--space-5) |
| --table-border-bottom-rule-hair | var(--rule-hair) |
| --table-border-bottom-line | var(--line) |
| --table-border-bottom-rule | var(--rule) |
| --table-border-bottom-ink | var(--ink) |
| --table-font-weight-weight-strong | var(--weight-strong) |
| --table-margin-top-space-8 | var(--space-8) |
| --table-background-surface | var(--surface) |
| --table-border-rule-hair | var(--rule-hair) |
| --table-border-line | var(--line) |
| --table-border-radius-radius | var(--radius) |
Layout
| Aspect | Value |
|---|---|
| breakpoints | Required review at 390, 768, 1024 and 1440 px; execution is not implied by this declaration; scrolls sideways inside its wrapper on phones (never the page). |
| wrapping | Cells wrap; the wrapper scrolls when columns cannot shrink. |
| textExpansion | Japanese cells wrap. |
Spacing and rhythm
| Aspect | Value |
|---|---|
| internal | --space-4 cell padding. |
| external | --space-6 above and below. |
| rhythm | Inside prose. |
Motion
| Aspect | Value |
|---|---|
| None | Static. |
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 | region (labelled) containing a table |
| name | The label |
| keyboard | Tab to the region, arrows scroll. |
| focus | One stop for the region. |
| screenReader | Reads headers with each cell (scope). |
| contrast | Ink on cotton. |
| target | Not a target. |
Content
| Slot | Length | Voice |
|---|---|---|
| html | 7 columns | Short cells |
Good: “Capability | State | What it does today”
Bad: “A table used to place two columns of prose”
Japanese: Status names and states have Japanese versions in the status page data.
Icons and illustrations
None: this element uses no icon or illustration of its own.
Decisions and exceptions
Usage
36 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.