Auto-playing marquees and hero loops look lively until someone needs the page to sit still. WCAG 2.2 Success Criterion 2.2.2 asks for a pause, stop, or hide control when moving content starts on its own, runs longer than five seconds, and sits next to other content. This guide walks through a small React marquee that meets that bar and still respects prefers-reduced-motion.
In the Library
Marquee playing.
Try the demo: Pause holds the strip where it is, even after focus moves on, and Play picks up from the same spot. Turn on reduced motion in your system settings and the strip becomes a still list.
What SC 2.2.2 actually requires
From the normative text in WCAG 2.2 §2.2.2 and the Understanding document: for moving, blinking, or scrolling information that (1) starts automatically, (2) lasts more than five seconds, and (3) is presented in parallel with other content, there must be a mechanism to pause, stop, or hide it, unless the motion is essential to the activity.
| Condition | Typical hero / marquee |
|---|---|
| Starts automatically | CSS animation or Motion animate on mount |
| Lasts more than five seconds | Infinite loop or long loop |
| Parallel with other content | Logo strip beside a headline and CTA |
| Mechanism | A real Pause control the user can leave and come back to |
A few Understanding notes that trip people up:
- Hover-to-pause that restarts the moment focus leaves is not a valid pause mechanism: it ties up focus and makes the page unusable while "paused."
- Content under five seconds can stop on its own (technique G11), but infinite marquees never qualify.
- Loading-only animations that are the sole content on the page can be essential; a logo ticker next to a form is not.
SC 2.2.2 is Level A and listed under Conformance Requirement 5 (Non-Interference): a failing marquee can break the whole page's conformance claim even if the rest is fine.
Reduced motion is a separate (related) duty
prefers-reduced-motion: reduce means the visitor asked the OS to cut non-essential movement (MDN). That's not the same as SC 2.2.2, and you need both:
- Everyone gets a pause, stop, or hide control for long auto-playing motion.
- Visitors who reduce motion get a non-scrolling (or opacity-only) presentation, so the meaning stays without the movement. That's the same rule Motionbits uses in How each piece handles reduced motion and The motion rules behind every piece.
Motion's useReducedMotion hook reads that preference and re-renders when it changes.
A minimal pausable marquee
import { useEffect, useId, useState } from "react";
import { useReducedMotion } from "motion/react";
type Props = { items: string[]; label?: string };
export function PausableMarquee({ items, label = "Featured items" }: Props) {
const reduceMotion = useReducedMotion();
const [paused, setPaused] = useState(false);
const regionId = useId();
const statusId = useId();
const trackId = useId();
const shouldScroll = !reduceMotion && !paused;
useEffect(() => { if (reduceMotion) setPaused(true); }, [reduceMotion]);
if (reduceMotion) {
return (
<section aria-labelledby={regionId} className="marquee marquee--static">
<h2 id={regionId}>{label}</h2>
<ul>{items.map((item) => <li key={item}>{item}</li>)}</ul>
</section>
);
}
const track = [...items, ...items];
return (
<section aria-labelledby={regionId} className="marquee">
<div className="marquee__chrome">
<h2 id={regionId}>{label}</h2>
<button
type="button"
aria-pressed={paused}
aria-controls={trackId}
aria-describedby={statusId}
onClick={() => setPaused((p) => !p)}
>
{paused ? "Play" : "Pause"}
</button>
</div>
<p id={statusId} aria-live="polite">{paused ? "Marquee paused." : "Marquee playing."}</p>
<div className="marquee__viewport">
<ul
id={trackId}
className="marquee__track"
style={{ animationPlayState: shouldScroll ? "running" : "paused" }}
>
{track.map((item, i) => (
<li key={`${item}-${i}`} aria-hidden={i >= items.length || undefined}>{item}</li>
))}
</ul>
</div>
</section>
);
}
.marquee__viewport { overflow: hidden; }
.marquee__track {
display: flex;
gap: 1.5rem;
width: max-content;
list-style: none;
margin: 0;
padding: 0.5rem 0;
animation: marquee-scroll 12s linear infinite;
}
@keyframes marquee-scroll {
from { transform: translateX(0); }
to { transform: translateX(-50%); }
}
Why this shape:
- Pause is a button, not hover. Focus can leave, and the animation stays paused until Play.
animation-play-statefreezes the CSS timeline in place, so a marquee that isn't real-time status resumes where the user left off.aria-pressedandaria-liveexpose state without trapping anyone.- The reduced-motion branch removes the moving track entirely and keeps the items readable as a list.
Heroes and auto-advancing headlines
The same checklist applies to a hero video loop, a background particle field, or an auto-cycling headline like Diff Headline, whose automatic cycle pauses with reduced motion. The pattern:
- Gate the loop on
!useReducedMotion(). - Offer Pause / Play (or Stop) next to the motion: keyboard reachable, visible in both light and dark.
- Pause in place for decorative loops; jump to live only for true real-time feeds.
- Keep the control outside the moving region so it never races the content.
If you ship several moving elements on one page, the Understanding document suggests a single page-level "Pause animations" control in addition to per-widget buttons. It's advisory, but kinder.
Quick conformance checklist
- Motion starts without user activation and runs past five seconds beside other content, so Pause, Stop or Hide exists.
- The control doesn't require holding focus or hover to stay paused.
- Keyboard users can reach and activate it, and its name and pressed state are clear.
prefers-reduced-motion: reduceswaps to a static or opacity-only presentation.- Only
transformandopacityanimate, so pausing doesn't thrash layout. - You didn't invent an "essential" exception for marketing chrome.
Try it with Motionbits
Every Motionbits piece reads the reduced-motion setting; How each piece handles reduced motion lists what each one does. Tumble Tabs and Diff Headline have live demos, the Library has the rest, and The motion rules behind every piece covers why only transform and opacity move.
Sources
- W3C, WCAG 2.2, SC 2.2.2 Pause, Stop, Hide
- W3C WAI, Understanding SC 2.2.2
- MDN, prefers-reduced-motion
- Motion, useReducedMotion