Organism · beta · v1.0.0 · owner: Site system lead · contract 19 of 20 points (open: figma)
Do and don't
Do: In the hero
Rendered by drift-hero.tsOpen example: Hero panel (a change, governed) · Do: In the hero Use the full-page example to follow page links.
Do: Japanese
Rendered by drift-hero.tsOpen example: Hero panel (a change, governed) · Do: Japanese Use the full-page example to follow page links.
Don't: In a deep page
Rendered by drift-hero.tsOpen example: Hero panel (a change, governed) · Don't: In a deep page Use the full-page example to follow page links.
Don't: Without its sample caption
Rendered by drift-hero.tsOpen example: Hero panel (a change, governed) · Don't: Without its sample caption Use the full-page example to follow page links.
Rules
| Rule | Why | Check |
|---|---|---|
| Hero panel (a change, governed) is computed by Loom's code from a sample checkout change run through Loom's real checks (scripts/site/interactives/drift-hero.ts), not drawn by hand. | A showcase is proof only if the product's own code produced what it shows. | Automated: scripts/site/interactives/check.ts (recomputes the showcase data and fails on drift) |
| Used only in the landing hero. | A signature moment repeated loses its effect. | Automated: scripts/site/system/check-pages.ts (usage count 2: EN and JA landing) |
API
| Prop | Type | Required | Default | What it does |
|---|---|---|---|---|
lang | en | ja | No | "en" | Interface language. |
Contract details
The full contract: identity, anatomy, variants, states, tokens, layout, motion, accessibility, content, tests
Identity
| Aspect | Value |
|---|---|
| Id | drift-hero |
| Layer | Organisms |
| Category | showcase |
| Owner | Site system lead |
| Status | beta |
| Version | 1.0.0 |
| Source | apps/showcase/site/system/organisms/drift-hero.ts (private repository; the contract and the render function are this one module) |
| Version | Date | Change |
|---|---|---|
| 1.0.0 | 2026-10-26 | Hero panel (a change, governed): computed by Loom's code from a sample checkout change run through Loom's real checks (scripts/site/interactives/drift-hero.ts). |
Use when
- The landing hero, beside the promise. Why: The first screen shows the product working, not a slogan.
Do not use when
- Anywhere else. Why: It is the hero's one live moment.
Anatomy
| Part | What it is |
|---|---|
| root | div.ix-dh |
| ui | A mock product screen |
| ladder | The steps of the change |
| controls | Playback controls |
| caption | Sample change, real checks |
Made of: showcase-frame, playback-controls, finding, caption.
Used in: hero.
Variants
| Variant | When | Why |
|---|---|---|
| full | On its demo page and its section. | The whole experience where the claim is made. |
States
| State | Rendered or not applicable |
|---|---|
| default | The final, complete step (what readers without JavaScript see). |
| hover | Its controls show hover; the content does not change on hover. |
| focus-visible | Every control shows the --focus ring. |
| active | Playing: the play control reads Pause and the steps advance. |
| disabled | Not applicable: Controls are hidden, not disabled, when they cannot act. |
| loading | The build-time specimen remains readable while its browser chunk loads. Managed bindings expose controls after validated initialization; unmanaged bindings retain their native startup behavior and unverified result. |
| empty | Not applicable: The data is part of the build; a showcase without data fails the build. |
| error | Managed bindings restore readable static content and hidden inert controls on caught chunk/initialization failure, then retry by remount. Unmanaged bindings catch chunk/throw failures, but a resolved initializer can mask internal data/DOM failure; its ready marker is not verified success. Unmanaged recovery requires a page reload. Enhancement failure is separate from business-data errors. |
| current | The current step is named in words (aria-valuetext and the step label). |
| visited | Not applicable: Not a link. |
| expanded | Not applicable: It does not open or close. |
Tokens
| Part | Token |
|---|---|
| root.ground | --surface on the indigo hero |
| step.current | --saffron rule |
| code.font | --font-mono |
| --drift-hero-background-surface | var(--surface) |
| --drift-hero-color-ink | var(--ink) |
| --drift-hero-border-top-rule-frame | var(--rule-frame) |
| --drift-hero-border-top-ink | var(--ink) |
| --drift-hero-padding-space-6 | var(--space-6) |
| --drift-hero-padding-space-10 | var(--space-10) |
| --drift-hero-gap-space-8 | var(--space-8) |
| --drift-hero-outline-focus | var(--focus) |
| --drift-hero-font-type-lede | var(--type-lede) |
| --drift-hero-letter-spacing-ls-lede | var(--ls-lede) |
| --drift-hero-gap-space-9 | var(--space-9) |
| --drift-hero-background-sample-4 | var(--sample-4) |
| --drift-hero-color-sample-1 | var(--sample-1) |
| --drift-hero-font-family-font-sample | var(--font-sample) |
| --drift-hero-border-radius-radius-sample | var(--radius-sample) |
| --drift-hero-padding-space-8 | var(--space-8) |
| --drift-hero-gap-space-5 | var(--space-5) |
| --drift-hero-font-type-strong | var(--type-strong) |
| --drift-hero-padding-space-3 | var(--space-3) |
| --drift-hero-padding-space-4 | var(--space-4) |
| --drift-hero-margin-space-4 | var(--space-4) |
| --drift-hero-box-shadow-rule-hair | var(--rule-hair) |
| --drift-hero-transition-dur-moderate | var(--dur-moderate) |
| --drift-hero-transition-ease-standard | var(--ease-standard) |
| --drift-hero-font-type-small | var(--type-small) |
| --drift-hero-font-type-h3 | var(--type-h3) |
| --drift-hero-box-shadow-rule | var(--rule) |
| --drift-hero-box-shadow-madder | var(--madder) |
| --drift-hero-box-shadow-saffron | var(--saffron) |
| --drift-hero-border-rule-hair | var(--rule-hair) |
| --drift-hero-border-sample-2 | var(--sample-2) |
| --drift-hero-background-sample-on | var(--sample-on) |
| --drift-hero-background-sample-2 | var(--sample-2) |
| --drift-hero-color-sample-on | var(--sample-on) |
| --drift-hero-font-type-small-strong | var(--type-small-strong) |
| --drift-hero-margin-space-6 | var(--space-6) |
| --drift-hero-margin-space-3 | var(--space-3) |
| --drift-hero-font-type-label | var(--type-label) |
| --drift-hero-color-ink-2 | var(--ink-2) |
| --drift-hero-font-family-font-mono | var(--font-mono) |
| --drift-hero-gap-space-2 | var(--space-2) |
| --drift-hero-gap-space-3 | var(--space-3) |
| --drift-hero-background-cotton | var(--cotton) |
| --drift-hero-background-madder-soft | var(--madder-soft) |
| --drift-hero-color-madder-ink | var(--madder-ink) |
| --drift-hero-background-teal-soft | var(--teal-soft) |
| --drift-hero-color-teal-ink | var(--teal-ink) |
| --drift-hero-font-type-h2 | var(--type-h2) |
| --drift-hero-letter-spacing-ls-h2 | var(--ls-h2) |
| --drift-hero-gap-space-4 | var(--space-4) |
| --drift-hero-padding-space-5 | var(--space-5) |
| --drift-hero-border-bottom-rule-hair | var(--rule-hair) |
| --drift-hero-border-bottom-line | var(--line) |
| --drift-hero-font-type-body | var(--type-body) |
| --drift-hero-transition-dur-slow | var(--dur-slow) |
| --drift-hero-color-on-dye | var(--on-dye) |
| --drift-hero-color-on-saffron | var(--on-saffron) |
| --drift-hero-background-band-loose | var(--band-loose) |
| --drift-hero-transition-dur-weave | var(--dur-weave) |
| --drift-hero-background-band-woven | var(--band-woven) |
| --drift-hero-background-band-holding | var(--band-holding) |
| --drift-hero-background-saffron | var(--saffron) |
| --drift-hero-border-top-rule | var(--rule) |
| --drift-hero-border-top-madder | var(--madder) |
| --drift-hero-border-top-color-saffron | var(--saffron) |
| --drift-hero-border-top-color-teal | var(--teal) |
| --drift-hero-color-saffron-ink | var(--saffron-ink) |
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 and controls fill the row on phones. |
| wrapping | Text wraps; code panes scroll inside their own focusable region. |
| textExpansion | Japanese strings come from the i18n tables and wrap; engine output stays English. |
Spacing and rhythm
| Aspect | Value |
|---|---|
| internal | Inside the Showcase frame's padding, controls and caption at its foot. |
| external | Full width of its section. |
| rhythm | One showcase per section, after the section's claim (D-SITE-008). |
Motion
| Aspect | Value |
|---|---|
| moves | Its steps, one at a time. |
| trigger | Scrolled into view (IntersectionObserver), or the play control. |
| duration | Authored frame holds belong to each registered runtime motion profile, not one shared range. DriftHero: 1.6/2.4/2.4 s, Conversations: 3 s, V4: 4 s; unknown legacy timings remain unassessed. Registered Web Animations transitions use --dur-weave. |
| easing | Per registered profile: Claude showcase arrivals use --ease-enter; V4 geometry uses --ease-standard. Other legacy bindings remain unassessed. |
| interruptible | Yes: pause, the slider and keyboard End stop or jump at once. |
| reduced | No autoplay: the final step is shown and the reader steps through with the controls. |
| why | The showcase proves a claim by letting the reader watch Loom's code do the work. |
Runtime and reuse
stylesheet: /css/site.css. Built Site tokens, core and registered element CSS; preserve modes, focus and responsive rules.
stylesheet: /css/demos.css. Existing legacy demo styles where the rendered specimen uses them.
font: /fonts/. Self-hosted files referenced by Site @font-face, with licences; Japanese locale overrides remain applicable.
Static fallback: Original build-time specimen remains readable before loading and after chunk/initialization failure; enhancement controls retain authored hidden state.
Configured initializer: apps/showcase/site/interactives/drift-hero.ts#init. The host owns transactional static-markup restoration and runtime state.
Consumer module (imports relative to the configured source root): import { createRuntimeHost } from "./src/workflows/runtime-host"; import { SITE_RUNTIMES } from "./apps/showcase/site/runtime-registry"; const definition = SITE_RUNTIMES.find(entry => entry.binding.id === "drift-hero"); if (!definition || definition.binding.lifecycle.kind !== "managed") throw new Error("Managed runtime binding unavailable"); const host = createRuntimeHost([definition]); export function mountRuntime(container: ParentNode) { return host.mountAll(container); }After inserting the rendered markup, call mountRuntime(container) for the container holding [data-demo="drift-hero"]. Retain the returned disposal function and call it before removing, replacing or remounting, including every Storybook args render. The configured host restores captured static markup/attributes on disposal or caught load/initialization failure; retry starts a fresh managed remount.
Accessibility passport
| Aspect | Value |
|---|---|
| role | region with a heading, or a figure |
| name | Its heading or caption |
| keyboard | Tab to the controls; Space plays or pauses; arrows move the steps; End shows the last step. |
| focus | Controls in reading order; focus never moves on its own. |
| screenReader | Manual frame selection and pause announce their settled content. Explicit Play announces the final settled summary once; autoplay and system interruption/disposal stay silent. Legacy initializers outside the shared player remain explicitly unassessed. |
| contrast | Ink on surface 14:1; state dyes only as marks with words. |
| target | Controls are 44 px. |
Content
| Slot | Length | Voice |
|---|---|---|
| caption | 1 sentence | Sample change; the checks are Loom's own |
Good: “A sample change. The checks are Loom's own code.”
Bad: “Live from a client”
Japanese: i18n.ts ix.dh.*.
Icons and illustrations
None: this element uses no icon or illustration of its own.
Decisions and exceptions
Usage
76 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.