Playback controls

Gives the reader control of a self-playing showcase: play or pause, and move to any step with a slider.

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.ts

Open example: Playback controls · Do: Controls for a five-step showcase Use the full-page example to follow page links.

Shows the final step without JavaScript; the reader controls the pace.

Do: Japanese

Rendered by playback-controls.ts

Open example: Playback controls · Do: Japanese Use the full-page example to follow page links.

Translated labels.

Don't: Autoplay without controls

Rendered by playback-controls.ts

Open example: Playback controls · Don't: Autoplay without controls Use the full-page example to follow page links.

Moving content needs a way to pause (WCAG 2.2.2).

Don't: An icon-only button

Rendered by playback-controls.ts

Open example: Playback controls · Don't: An icon-only button Use the full-page example to follow page links.

Name the control in words.

Rules

RuleWhyCheck
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

PropTypeRequiredDefaultWhat it does
playstringYesThe play button's label.
stepsstringYesThe slider's accessible name.
maxnumberYesLast step index.
valuenumberYesThe step shown without JavaScript.
valuetextstringYesThe step in words.

Contract details

The full contract: identity, anatomy, variants, states, tokens, layout, motion, accessibility, content, tests

Identity

AspectValue
Idplayback-controls
LayerMolecules
Categorymedia
OwnerSite system lead
Statusbeta
Version1.0.0
Sourceapps/showcase/site/system/molecules/playback-controls.ts (private repository; the contract and the render function are this one module)
VersionDateChange
1.0.02026-10-26Play 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

PartWhat it is
rootdiv[data-pl-controls]
playbutton.ix-pl-play
rangelabel.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

VariantWhenWhy
play and stepsEvery playing showcase.The same controls everywhere.

States

StateRendered or not applicable
defaultHidden until the script runs (no-JS readers see the final step)
hoverThe play button's background --surface-2.
focus-visibleThe --focus ring on the button and the slider.
activePlaying: the button reads Pause (aria-pressed).
disabledNot applicable: Never disabled; hidden when it cannot act.
loadingNot applicable: Data is in the page.
emptyNot applicable: Every showcase has steps.
errorNot applicable: Nothing can fail.
currentaria-valuetext names the current step.
visitedNot applicable: Not a link.
expandedNot applicable: Not a disclosure.

Tokens

PartToken
play.border--rule-hair currentColor
range.accent-color--saffron
root.gap--space-5
--playback-controls-padding-space-6var(--space-6)
--playback-controls-border-radius-radiusvar(--radius)
--playback-controls-background-inkvar(--ink)
--playback-controls-color-cottonvar(--cotton)
--playback-controls-box-shadow-space-2var(--space-2)
--playback-controls-box-shadow-saffronvar(--saffron)
--playback-controls-font-type-small-strongvar(--type-small-strong)
--playback-controls-accent-color-indigovar(--indigo)

Layout

AspectValue
breakpointsRequired review at 390, 768, 1024 and 1440 px; execution is not implied by this declaration; the slider fills the row on phones.
wrappingButton and slider wrap.
textExpansionJapanese labels fit the button.

Spacing and rhythm

AspectValue
internal--space-5 between button and slider.
externalIn the showcase foot.
rhythmBelow the showcase, above its caption.

Motion

AspectValue
NoneThe controls do not move; they move the showcase.

Runtime and reuse

  1. Render-only element; mount any registered child enhancements separately. Preserve required Site CSS, fonts, responsive and locale rules from nativeElement.

Accessibility passport

AspectValue
rolebutton and slider
namePlay/Pause; the steps label
keyboardSpace plays or pauses; arrow keys move the slider; End jumps to the last step.
focusButton then slider.
screenReaderReads the step in words (aria-valuetext).
contrastAs the button; the slider thumb meets 3:1.
target44 px.

Content

SlotLengthVoice
play2 wordsPlay / 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

AspectValue
unittests/unit/site-system.test.ts: renders every do and don't example through the registry and checks the classes it owns
visualNot yet: there are no screenshot baselines; the Library page is checked for sideways scroll at 1440 px by tests/site/system.spec.ts
a11ytests/site/system.spec.ts: axe (0 serious or critical) on the element's Library page in light and dark
parityscripts/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.

Open in Storybook

Start with a conversation about your system.

We read your system, show you what we found, and agree with your team what to fix first.