Organism · stable · v1.1.0 · owner: Site system lead · contract 19 of 20 points (open: figma)
Do and don't
Do: Mini audit
Rendered by showcase-frame.tsOpen example: Showcase frame · Do: Mini audit Use the full-page example to follow page links.
Do: Score us
Rendered by showcase-frame.tsOpen example: Showcase frame · Do: Score us Use the full-page example to follow page links.
Do: Existing metadata arrangement
Rendered by showcase-frame.tsOpen example: Showcase frame · Do: Existing metadata arrangement Use the full-page example to follow page links.
Do: Native labelled group
Rendered by showcase-frame.tsOpen example: Showcase frame · Do: Native labelled group Use the full-page example to follow page links.
Don't: No caption
Rendered by showcase-frame.tsOpen example: Showcase frame · Don't: No caption Use the full-page example to follow page links.
Don't: Own controls
Rendered by showcase-frame.tsOpen example: Showcase frame · Don't: Own controls Use the full-page example to follow page links.
Rules
| Rule | Why | Check |
|---|---|---|
| Preserve native binding, label and caption placement; managed/static bindings never coexist. | Shared construction must retain real runtime selectors and readable fallback. | Automated: tests/unit/frame-api-compatibility.test.ts |
| Every self-playing element sits in this frame. | One frame, one meaning (D-SITE-008). | Automated: scripts/site/system/check-pages.ts (data-pl-controls only inside a frame) |
API
| Prop | Type | Required | Default | What it does |
|---|---|---|---|---|
variant | framed | native | No | "framed" | Existing section/head or an owned native div/figure root without added chrome. |
as | div | figure | No | Native root only; V4/list/screen families keep their semantic contracts. | |
className | string | No | Existing native root class list. | |
lang | en | ja | No | Explicit source language. | |
staticDemo | string | No | Static-only binding, exclusive with demo; constructor never mounts controls. | |
headingId | string | No | Explicit framed heading ID, default id-title. | |
leadingClass | string | No | Existing class before demo, preserving native ordering. | |
headClass | string | No | Existing inner head class. | |
afterTitle | html | No | Existing explanation/source after title inside its inner div. | |
headMeta | html | No | Existing metadata sibling in demo-head. | |
ledePlacement | inside-head | after-head | No | "inside-head" | Existing lede location. |
data | object | No | Native scalar data-* only; binding keys reserved. No style/events/arbitrary attrs. | |
role | group | No | Optional native group requires an actual name. | |
label | string | No | Native text name, exclusive with labelledBy. | |
labelledBy | string | No | Actual native body/caption label IDs. | |
caption | object | No | Caption props; native figure requires figcaption, div accepts p/span. | |
afterCaption | html | No | Existing content after caption; no generated behavior. | |
id | string | No | Required framed section ID; optional native ID. | |
demo | string | No | Managed data-demo name, exclusive with staticDemo; framed form needs one binding. | |
title | string | No | Required framed claim; native form retains body labels. | |
lede | html | No | One line. | |
body | html | Yes | The showcase. | |
extraClass | string | No | demo-<name>. |
Contract details
The full contract: identity, anatomy, variants, states, tokens, layout, motion, accessibility, content, tests
Identity
| Aspect | Value |
|---|---|
| Id | showcase-frame |
| Layer | Organisms |
| Category | media |
| Owner | Site system lead |
| Status | stable |
| Version | 1.1.0 |
| Source | apps/showcase/site/system/organisms/showcase-frame.ts (private repository; the contract and the render function are this one module) |
| Version | Date | Change |
|---|---|---|
| 1.1.0 | 2026-10-29 | Add existing native-root and legacy-head arrangements; preserve default frame and caller-owned lifecycle. |
Use when
- Every self-playing or interactive element. Why: Readers learn one frame means 'this runs'; one set of controls everywhere (D-SITE-008).
Do not use when
- For static figures. Why: Figures use the Figure frame.
Anatomy
| Part | What it is |
|---|---|
| root | Framed section.demo or native div/figure with exclusive managed/static binding; caller IDs are never generated |
| head | Framed only: heading, source/meta slots and explicitly placed lede |
| body | The showcase |
| controls | Native child implementation owns playback, clocks and lifecycle; this constructor owns no behavior |
| caption | Caption (honesty) |
Made of: heading, text, playback-controls, caption.
Used in: academy-lesson, agent-check, autonomy-demo, before-after, contact-form, conversations, cost-calculator, drift-hero, first-90, health-check, jobs-strip, layers-demo, ops-board, proof-shift, read-your-stylesheet, replay, repo-change, score-us, stage-finder, survey.
Variants
| Variant | When | Why |
|---|---|---|
| framed | Shared demo head and body. | Default output unchanged. |
| native | Existing group/figure has native layout. | Constructor owns root, binding, label and caption without another box. |
States
| State | Rendered or not applicable |
|---|---|
| default | The final state. |
| hover | Controls show hover. |
| focus-visible | --focus on controls. |
| active | Playing. |
| disabled | Not applicable: Controls hide rather than disable. |
| loading | Build-time final state until the script runs. |
| empty | Not applicable: A showcase without data fails the build. |
| error | Not applicable: Nothing fetched at run time. |
| current | The current step named in words. |
| visited | Not applicable: Not a link. |
| expanded | Not applicable: Does not open. |
Tokens
| Part | Token |
|---|---|
| frame.background | --surface |
| frame.border-top | --rule-frame --ink |
| --showcase-frame-gap-space-7 | var(--space-7) |
| --showcase-frame-margin-top-space-10 | var(--space-10) |
| --showcase-frame-margin-top-space-13 | var(--space-13) |
| --showcase-frame-padding-space-7 | var(--space-7) |
| --showcase-frame-padding-space-9 | var(--space-9) |
| --showcase-frame-background-surface | var(--surface) |
| --showcase-frame-border-line | var(--line) |
| --showcase-frame-border-radius-radius | var(--radius) |
| --showcase-frame-gap-space-5 | var(--space-5) |
| --showcase-frame-gap-space-3 | var(--space-3) |
| --showcase-frame-font-size-fs-h3 | var(--fs-h3) |
| --showcase-frame-letter-spacing-ls-h2 | var(--ls-h2) |
| --showcase-frame-color-ink-2 | var(--ink-2) |
| --showcase-frame-font-size-fs-small | var(--fs-small) |
| --showcase-frame-font-type-label | var(--type-label) |
| --showcase-frame-padding-space-6 | var(--space-6) |
| --showcase-frame-color-ink | var(--ink) |
| --showcase-frame-border-top-rule | var(--rule) |
| --showcase-frame-border-top-ink | var(--ink) |
| --showcase-frame-transition-dur-moderate | var(--dur-moderate) |
| --showcase-frame-transition-ease-standard | var(--ease-standard) |
| --showcase-frame-font-type-h3 | var(--type-h3) |
| --showcase-frame-letter-spacing-ls-h3 | var(--ls-h3) |
| --showcase-frame-transition-dur-slow | var(--dur-slow) |
| --showcase-frame-outline-color-ink | var(--ink) |
| --showcase-frame-margin-top-space-8 | var(--space-8) |
Layout
| Aspect | Value |
|---|---|
| breakpoints | Required review at 390, 768, 1024 and 1440 px; execution is not implied by this declaration; columns stack under 768 px; the wrap keeps a 16 px gutter on phones. |
| wrapping | Text wraps; nothing scrolls sideways. |
| textExpansion | Japanese runs 20 to 40% longer; headings break between phrases (jaBreaks) and blocks grow downwards. |
Spacing and rhythm
| Aspect | Value |
|---|---|
| internal | --space-7 padding. |
| external | Full width of its section. |
| rhythm | One per section, after the claim. |
Motion
| Aspect | Value |
|---|---|
| moves | The showcase inside, never the frame. |
| trigger | Its controls or entering view. |
| duration | As the showcase. |
| easing | --ease-standard |
| interruptible | Always. |
| reduced | No autoplay. |
| why | The frame holds still so the content can move. |
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 | Framed section named by its generated heading; native role/name preserve the caller contract |
| name | Explicit framed heading ID or native body/caption label |
| keyboard | No listeners or focus changes; child controls retain native behavior |
| focus | No new focus stop or live announcement |
| screenReader | Read in source order; decorative weaving is aria-hidden. |
| contrast | Ink on cotton 14:1; text on every dye field 4.5:1 or better (checked by check-brand). |
| target | Links and buttons are 44 px tall. |
Content
| Slot | Length | Voice |
|---|---|---|
| title | 12 words | The claim the showcase proves |
Good: “Your stylesheet already knows where the system is loosening.”
Bad: “Demo”
Japanese: From the i18n tables of each showcase.
Icons and illustrations
None: this element uses no icon or illustration of its own.
Decisions and exceptions
- D-SITE-008: One ShowcaseFrame for every self-playing element
- EX-SITE-003: Older showcases (score us, mini audit and the ix-* interactives) still write the frame markup themselves instead of calling this module. Owner: Site system lead; expires 2026-11-30.
Usage
67 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.