Molecule · beta · v1.0.0 · owner: Site system lead · contract 19 of 20 points (open: figma)
Do and don't
Do: Controls for a five-step showcase
Rendered by playback-controls.tsOpen example: Playback controls · Do: Controls for a five-step showcase Use the full-page example to follow page links.
Do: Japanese
Rendered by playback-controls.tsOpen example: Playback controls · Do: Japanese Use the full-page example to follow page links.
Don't: Autoplay without controls
Rendered by playback-controls.tsOpen example: Playback controls · Don't: Autoplay without controls Use the full-page example to follow page links.
Don't: An icon-only button
Rendered by playback-controls.tsOpen example: Playback controls · Don't: An icon-only button Use the full-page example to follow page links.
Rules
| Rule | Why | Check |
|---|---|---|
| Every showcase that moves has play and pause. | WCAG 2.2.2: people must be able to stop motion. | Automated: tests/site/interactives.spec.ts |
| Without JavaScript the showcase shows its final, complete step. | The point must arrive even when the script does not. | Automated: tests/site/pages.spec.ts (without JavaScript) |
API
| Prop | Type | Required | Default | What it does |
|---|---|---|---|---|
play | string | Yes | The play button's label. | |
steps | string | Yes | The slider's accessible name. | |
max | number | Yes | Last step index. | |
value | number | Yes | The step shown without JavaScript. | |
valuetext | string | Yes | The step in words. |
Contract details
The full contract: identity, anatomy, variants, states, tokens, layout, motion, accessibility, content, tests
Identity
| Aspect | Value |
|---|---|
| Id | playback-controls |
| Layer | Molecules |
| Category | media |
| Owner | Site system lead |
| Status | beta |
| Version | 1.0.0 |
| Source | apps/showcase/site/system/molecules/playback-controls.ts (private repository; the contract and the render function are this one module) |
| Version | Date | Change |
|---|---|---|
| 1.0.0 | 2026-10-26 | Play and a step slider for every self-playing showcase. |
Use when
- Any showcase that plays steps over time. Why: People must be able to stop, rewind and read at their own pace (WCAG 2.2.2).
Do not use when
- For a static figure. Why: Nothing to control.
Anatomy
| Part | What it is |
|---|---|
| root | div[data-pl-controls] |
| play | button.ix-pl-play |
| range | label.ix-pl-range with a visually hidden name and input[type=range] |
Made of: button, control, tokens:colour.
Used in: conversations, drift-hero, first-90, ops-board, proof-shift, replay, showcase-frame.
Variants
| Variant | When | Why |
|---|---|---|
| play and steps | Every playing showcase. | The same controls everywhere. |
States
| State | Rendered or not applicable |
|---|---|
| default | Hidden until the script runs (no-JS readers see the final step) |
| hover | The play button's background --surface-2. |
| focus-visible | The --focus ring on the button and the slider. |
| active | Playing: the button reads Pause (aria-pressed). |
| disabled | Not applicable: Never disabled; hidden when it cannot act. |
| loading | Not applicable: Data is in the page. |
| empty | Not applicable: Every showcase has steps. |
| error | Not applicable: Nothing can fail. |
| current | aria-valuetext names the current step. |
| visited | Not applicable: Not a link. |
| expanded | Not applicable: Not a disclosure. |
Tokens
| Part | Token |
|---|---|
| play.border | --rule-hair currentColor |
| range.accent-color | --saffron |
| root.gap | --space-5 |
| --playback-controls-padding-space-6 | var(--space-6) |
| --playback-controls-border-radius-radius | var(--radius) |
| --playback-controls-background-ink | var(--ink) |
| --playback-controls-color-cotton | var(--cotton) |
| --playback-controls-box-shadow-space-2 | var(--space-2) |
| --playback-controls-box-shadow-saffron | var(--saffron) |
| --playback-controls-font-type-small-strong | var(--type-small-strong) |
| --playback-controls-accent-color-indigo | var(--indigo) |
Layout
| Aspect | Value |
|---|---|
| breakpoints | Required review at 390, 768, 1024 and 1440 px; execution is not implied by this declaration; the slider fills the row on phones. |
| wrapping | Button and slider wrap. |
| textExpansion | Japanese labels fit the button. |
Spacing and rhythm
| Aspect | Value |
|---|---|
| internal | --space-5 between button and slider. |
| external | In the showcase foot. |
| rhythm | Below the showcase, above its caption. |
Motion
| Aspect | Value |
|---|---|
| None | The controls do not move; they move the showcase. |
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 | button and slider |
| name | Play/Pause; the steps label |
| keyboard | Space plays or pauses; arrow keys move the slider; End jumps to the last step. |
| focus | Button then slider. |
| screenReader | Reads the step in words (aria-valuetext). |
| contrast | As the button; the slider thumb meets 3:1. |
| target | 44 px. |
Content
| Slot | Length | Voice |
|---|---|---|
| play | 2 words | Play / Pause |
Good: “Play”
Bad: “▶”
Japanese: From the interactives' i18n tables.
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.