Skip to content
OAIT Design System

Design system / Components

Pause control

The 48px outlined icon button that pauses every animation in its region, required wherever something moves by itself for more than 5 seconds.

When to use

  • In every region where something starts by itself and moves, loops, or auto-advances for more than 5 seconds: the card stack and its float, sheen, and seal on oait's and Global ID's landing heroes, drifting kit shapes, an auto-advancing platform strip (canonical §7.5, D-SEM-17, WCAG 2.2.2).
  • One control per region, inside it, next to the art's other controls (the platform strip's label row on oait).

When not to use

Situation Use instead
Motion that ends within 5 seconds (the hero entrance, a card flip, a celebration) Nothing: one-shots finish by themselves (canonical §7.5)
A status loop that lasts only while its state does (a spinner, the live-dot halo, the pass viewfinder) Words beside the loop ("Ready to scan", "Loading people…"); no control (canonical §7.5)
Audio or video with a timeline The player's own play and pause controls
Ambient loops on a functional screen Remove the loop: ambient motion lives only in marketing hero art (D-SEM-17)
A toggle that switches a setting on and off A switch or an icon button with aria-pressed

Anatomy

  1. Region: the element that holds everything that moves, with an id (in the hero, .oa-hero__stage). Its script sets data-motion="paused" on it; base.css then pauses every animation inside.
  2. Button (.oa-pause): a native <button type="button">, a 48px circle with a 1px outline-variant hairline on surface-container-lowest, inside the region, with aria-controls naming it.
  3. Icon: pause while things move, play_arrow once paused; 24px, FILL 0, never mirrored.
  4. Tooltip: the plain tooltip with the same words as the name (Tooltip).

Variants

Variant Use for Key tokens
Moving ("Pause animation", pause) The region's animations run --color-surface-container-lowest, --color-outline-variant, --color-on-surface-variant
Paused ("Play animation", play_arrow) The person paused the region the same; the name and the glyph change

It is one outlined icon button with two names, not a toggle: it does not use aria-pressed, because its name says what a press does (Icon button, D-CAI-07, C-4).

Sizes

Size Height Padding Type style Icon size
One size 48px (--size-touch-target), a 48 × 48px circle none; the icon is centered none: the control has no visible words 24px (--size-icon-lg)

Tokens

Part Property Token
Button size --size-touch-target (48px)
Button corner --radius-full
Button edge 1px --color-outline-variant: a hairline is enough because the glyph identifies the control (D-ARC-13, V-2)
Button fill --color-surface-container-lowest, so the glyph stays readable over moving art (the motion record's Pause spec, D-SEM-17; canonical §10.2 gives only the hairline)
Icon color --color-on-surface-variant (7.2:1 or more light, 5.4:1 or more dark)
State layer hover, pressed --opacity-state-hover (0.08), --opacity-state-pressed (0.12) of the icon color
State layer fade --duration-short-3 with --ease-standard; pressed shows at once
Focus ring --size-focus-ring (3px) in --color-focus-ring, --size-focus-offset (2px) outside

States

State What changes
Enabled, moving pause glyph; name "Pause animation"
Enabled, paused play_arrow glyph; name "Play animation"
Hover An 8% layer of the icon color (only on devices that hover)
Pressed A 12% layer, at once
Focus-visible The family ring, 3px, 2px outside the circle
Reduced motion Hidden (display: none): nothing moves, so there is nothing to pause
Disabled, loading Never: the control is always available while its region moves

Behavior

  • Press. Toggles data-motion="paused" on the region. Every animation inside stops where it is (animation-play-state: paused, base.css) and the auto-advance timer stops; the name and the glyph switch. A second press plays everything again (D-SEM-17).
  • Memory. The choice holds for the rest of the visit: keep it in memory or sessionStorage and set the attribute again when the region comes back.
  • Auto-advance. Independently of the button, auto-advance waits while the pointer is over the region or focus is inside it, and stops for good once the person picks an item (canonical §7.5).
  • Reduced motion. Under prefers-reduced-motion: reduce the control is hidden and no timer starts. The script assumes reduced motion until the browser answers (server rendering), so the still version renders first (canonical §7.7).
  • The entrance. Keep the region inside the hero's rising art column, never around it: pausing a region that is still rising would freeze it half-faded.
  • Keyboard. Tab reaches it in reading order, before the art's other controls, so a person can stop the motion before reaching them (the platform strip puts it in its head row, before the tiles, D-CSN-38); Enter and Space press it. Focus stays on the button after a press.

The script contract (the motion foundation has the full sketch, with the auto-advance timer):

const region = document.getElementById("hero-art")
const pause = region.querySelector(".oa-pause")
const glyph = pause.querySelector(".oa-icon")
// The two names in the page language (Arabic and French after native review); the tooltip shows the same words.
const labels = { pause: "Pause animation", play: "Play animation" }
let paused = false
try { paused = sessionStorage.getItem("oa-motion") === "paused" } catch {} // remembered for the visit; storage may be blocked

function render() {
  if (paused) region.setAttribute("data-motion", "paused")
  else region.removeAttribute("data-motion")
  pause.setAttribute("aria-label", paused ? labels.play : labels.pause)
  glyph.textContent = paused ? "play_arrow" : "pause"
}
pause.addEventListener("click", () => {
  paused = !paused
  try { sessionStorage.setItem("oa-motion", paused ? "paused" : "playing") } catch {}
  render()
  schedule() // the auto-advance timer of the motion foundation's sketch: it never runs while paused
})
render()

See Motion for the timer that waits on pointer and focus, and stops when an item is picked.

Accessibility

  • Element. A native <button type="button"> with aria-controls set to the region's id (canonical §7.5, §10.0).
  • Name. aria-label in the page language, starting with the verb: "Pause animation", then "Play animation". The plain tooltip shows the same words; never the title attribute alone (canonical §10.2, §10.20).
  • Icon. aria-hidden="true" and translate="no", so the ligature name is neither read nor translated.
  • Target. 48 × 48px.
  • Contrast. The glyph on-surface-variant on surface-container-lowest reaches 7.2:1 or more (light) and 5.4:1 or more (dark); the hairline is enough because the glyph identifies the control (V-2).
  • WCAG 2.2.2. Pausing on hover and the reduced-motion setting are not mechanisms every person can find; the visible control is (D-SEM-17).
  • Over art. Where the control sits on multi-stop art or a photo (the card stack), add .oa-focus-halo (base.css): a 2px surface halo between its edge and the ring (canonical §6.3).
  • Forced colors. The hairline is drawn in the system's button border; the ring takes Highlight (base.css).

RTL and languages

  • The control sits at the inline end of its row, so in Arabic it moves to the left with the art; pause and play_arrow never mirror (canonical §8.3).
  • Names, in the page language (Arabic and French through native review, C-4):
English Arabic (native review) French (native review)
Moving Pause animation إيقاف الحركة مؤقتًا Mettre l’animation en pause
Paused Play animation تشغيل الحركة Lire l’animation

oait's shipped Arabic name, "إيقاف تبديل التطبيقات مؤقتًا", names the old "Pause app rotation" and changes with it.

Content

  • Two names only: "Pause animation" and "Play animation". Not "Pause app rotation" (it now stops every loop, C-4), not "Stop", not "Toggle animation".
  • No visible label beside the button; the region's own label ("Our platforms") is enough context.

Do and don't

Do Don't
One control that stops every loop in the region: rotation, float, sheen, seal, and drift A control that stops only the rotation while the card keeps floating (oait today)
A 48px circle A 44px circle (oait today)
The control inside the region, in reading order with the art's controls The control in the page footer or a settings page only
Hide it under reduced motion Show a control that does nothing
"Pause animation" and "Play animation", with the same words in the tooltip A title tooltip, or a name that never changes

Code

HTML (reference CSS)

In the hero's motion region (the whole art column):

<div class="oa-hero__art">
  <div class="oa-hero__stage" id="mk-hero-jobs-art">
    <span class="oa-shape oa-shape--squircle oa-shape--lavender oa-shape--turn-12 oa-shape--drift" aria-hidden="true" style="--oa-shape-size: clamp(96px, 34%, 160px); inset-block-start: 6%; inset-inline-end: 6%"></span>
    <span class="oa-shape oa-shape--cookie oa-shape--mint oa-shape--drift-slow" aria-hidden="true" style="--oa-shape-size: clamp(136px, 44%, 200px); inset-block-end: 0; inset-inline-start: 8%"></span>
    <span class="oa-shape oa-shape--sunny oa-shape--sand" aria-hidden="true" style="--oa-shape-size: clamp(72px, 20%, 96px); inset-block-start: 10%; inset-inline-start: 30%"></span>
    <button type="button" class="oa-pause" aria-controls="mk-hero-jobs-art" aria-label="Pause animation"><span class="oa-icon" aria-hidden="true" translate="no">pause</span></button>
  </div>
</div>

Paused:

<button type="button" class="oa-pause" aria-controls="mk-hero-jobs-art" aria-label="Play animation"><span class="oa-icon" aria-hidden="true" translate="no">play_arrow</span></button>

Arabic:

<button type="button" class="oa-pause" aria-controls="mk-hero-jobs-ar-art" aria-label="إيقاف الحركة مؤقتًا"><span class="oa-icon" aria-hidden="true" translate="no">pause</span></button>

Every state is in reference/snippets/marketing.html; the CSS is reference/css/marketing.css, and the pause rule for data-motion is in base.css.

Tailwind CSS v4

<button
  type="button"
  aria-controls="hero-art"
  aria-label={paused ? t("motion.play") : t("motion.pause")}
  onClick={toggle}
  /* grid, not inline-grid: with the spacing token grid, inline-grid also sets inline-size: 16px */
  className="relative isolate grid size-12 shrink-0 place-items-center rounded-full border border-outline-variant bg-surface-container-lowest text-on-surface-variant before:absolute before:-inset-px before:-z-1 before:rounded-[inherit] before:bg-current before:opacity-0 before:transition-opacity before:duration-short-3 before:ease-standard hover:before:opacity-(--opacity-state-hover) active:before:opacity-(--opacity-state-pressed) active:before:transition-none motion-reduce:hidden print:hidden"
>
  <Icon name={paused ? "play_arrow" : "pause"} size={24} />
</button>

Wrap it in the family's plain tooltip with the same words. The region takes data-motion="paused" from the same state; base CSS pauses its animations.

React

Prop Type Default Description
controls string — The id of the region it pauses.
paused boolean — Controlled state. Omit it to let the component keep the state for the visit (sessionStorage).
onPausedChange (paused: boolean) => void — Called on each press; the auto-advance timer listens to it.
labels { pause: string; play: string } — The two names, translated.
className string — Placement only (for example absolute end-0 bottom-0).
function HeroArt() {
  const [paused, setPaused] = useMotionPause("hero-art")
  useAutoAdvance(showNextCard, { paused })
  return (
    <div id="hero-art" data-motion={paused ? "paused" : undefined} className="relative aspect-4/3">
      <CardStack />
      <PauseControl
        controls="hero-art"
        paused={paused}
        onPausedChange={setPaused}
        labels={{ pause: t("motion.pause"), play: t("motion.play") }}
        className="absolute end-0 bottom-0"
      />
    </div>
  )
}

useMotionPause reads and writes the visit's choice; useAutoAdvance waits on hover and focus, stops after a pick, and never starts under reduced motion (it reads --duration-interval-carousel from the tokens).