Every major operating system has a setting that asks apps to cut down on motion. On Windows 11 it is Settings > Accessibility > Visual effects > Animation effects. On macOS it is Reduce motion in the Accessibility settings, on iOS it is under Accessibility > Motion, and on Android 9 and later it is Remove animations. Browsers pass the setting to pages through the prefers-reduced-motion media feature.
People turn it on for different reasons. Large movement such as parallax, zooming and sliding panels can cause dizziness or nausea for people with vestibular disorders. Others find constant motion distracting, get headaches from it, or simply prefer a calmer interface. You cannot tell which reason applies, so treat the setting as a request for less movement, not as a request for a broken or static site.
Reduce, not remove
The media feature is named reduced motion, and the useful reading of it is to remove movement through space while keeping changes that help people follow what happened. A panel that slides in from the side can fade in instead. A card that lifts and grows on hover can change its shadow or border. Feedback still exists; it just stops traveling.
Usually fine to keep:
- Opacity fades and crossfades, kept short.
- Color, border and shadow changes on hover, focus and press.
- Small state indicators, such as a checkbox tick drawing in or a loading spinner. A spinner tells people something is happening; consider slowing it rather than stopping it, or replacing it with a progress bar.
Replace or remove:
- Parallax and scroll-linked movement, where content moves at a different speed from the scroll.
- Large translations: elements flying in from off screen, page transitions that slide whole views.
- Zooming and scaling of large areas, including Ken Burns effects on hero images.
- Spinning, bouncing and shaking used as decoration or emphasis.
- Smooth scrolling for in-page links, and anything that takes over scrolling.
- Autoplaying video backgrounds, animated illustrations and carousels that advance by themselves.
The media query in CSS
prefers-reduced-motion has two values. reduce means the user has turned the setting on; no-preference means they have not. @media (prefers-reduced-motion) with no value is the same as checking for reduce. There are two ways to structure your CSS around it.
Opt out: write the full motion as the default, then override it for reduce. This is the common approach for small transitions, where the override is a line or two.
.drawer {
transition: transform 300ms ease-out, opacity 300ms ease-out;
}
.drawer[data-state="closed"] {
transform: translateX(100%);
opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
.drawer {
transition: opacity 200ms linear;
}
.drawer[data-state="closed"] {
transform: none;
}
}Opt in: put large or decorative motion inside a no-preference query, so it only exists for people who have not asked for less. This is safer for parallax, looping backgrounds and anything that would be uncomfortable if an override were missed, and browsers that do not support the media feature get the still version.
.hero-image {
transform: none;
}
@media (prefers-reduced-motion: no-preference) {
.hero-image {
animation: kenburns 20s ease-out both;
}
html {
scroll-behavior: smooth;
}
}
@keyframes kenburns {
from { transform: scale(1.08) translateY(2%); }
to { transform: scale(1) translateY(0); }
}In Tailwind CSS, the motion-safe: and motion-reduce: variants wrap a utility in the matching query, so class="motion-safe:animate-bounce" is the opt-in pattern and class="transition-transform motion-reduce:transition-none" is the opt-out one.
The global reset, and why it is a blunt tool
Many CSS resets include a block that shortens every animation and transition to almost nothing when reduce is set:
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}It uses 0.01ms rather than 0 so that animationend and transitionend events still fire and scripts waiting for them do not hang. As a safety net it is better than nothing, but it removes the helpful fades along with the harmful movement, freezes spinners after one turn so a loading state looks stuck, and its !important makes deliberate reduced-motion designs harder to write. Prefer specific overrides for the motion you designed, and use the reset only as a fallback for third-party components you cannot change.
Detecting the setting in JavaScript
Animations started from JavaScript (Web Animations API calls, scroll handlers, canvas, video) are not affected by CSS media queries, so check the preference with matchMedia. Listen for changes too; people do change the setting while a page is open.
const motionQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
let reduceMotion = motionQuery.matches;
motionQuery.addEventListener("change", (event) => {
reduceMotion = event.matches;
});
function revealCard(card) {
card.animate(
reduceMotion
? [{ opacity: 0 }, { opacity: 1 }]
: [
{ opacity: 0, transform: "translateY(24px)" },
{ opacity: 1, transform: "none" },
],
{ duration: reduceMotion ? 150 : 400, easing: "ease-out", fill: "both" }
);
}
function scrollToSection(el) {
el.scrollIntoView({ behavior: reduceMotion ? "auto" : "smooth" });
}In server-rendered apps, the server does not know the preference. Avoid rendering a moving first frame and correcting it after hydration. Either keep first-render motion in CSS, where the media query applies before anything paints, or start in the still state and enable motion once the client has checked.
With Motion for React
Motion (formerly Framer Motion) offers two levels of control. MotionConfig with reducedMotion="user" follows the device setting for every motion component inside it: transform and layout animations are disabled, while opacity and color animations keep running. That is the reduce-not-remove behavior with one line. The default is "never", so nothing changes unless you set it.
import { MotionConfig, motion, useReducedMotion } from "motion/react";
export function Providers({ children }: { children: React.ReactNode }) {
return <MotionConfig reducedMotion="user">{children}</MotionConfig>;
}
export function Banner() {
// true when reduced motion is on; null until it has been determined
const shouldReduceMotion = useReducedMotion();
return (
<motion.div
initial={{ opacity: 0, y: shouldReduceMotion ? 0 : 24 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: shouldReduceMotion ? 0.15 : 0.4 }}
/>
);
}Use useReducedMotion when the reduced version should be designed rather than just stripped, for example swapping a slide for a crossfade, turning off a background video, or disabling a parallax hook.
Autoplaying and looping content
Autoplay is where reduced motion and general usability overlap. Some rules that hold regardless of the setting, and some that depend on it:
- Background video: do not put autoplay in the HTML. Start playback from JavaScript only when reduced motion is not requested, and show the poster image otherwise. Always provide a visible pause control.
- Carousels: do not auto-advance when reduced motion is on, and pause on hover and focus for everyone.
- Animated GIFs: CSS cannot pause them. Serve a still frame through a picture element source with a media condition.
- Lottie and canvas animations: check the preference before calling play, and show the final frame instead.
<picture>
<source srcset="/img/demo-still.png" media="(prefers-reduced-motion: reduce)" />
<img src="/img/demo.gif" alt="The export menu opening and saving a PNG" />
</picture>
<video class="hero-video" muted loop playsinline poster="/img/hero-poster.jpg">
<source src="/video/hero.mp4" type="video/mp4" />
</video>
<button type="button" class="hero-video-toggle">Pause background video</button>const video = document.querySelector(".hero-video");
const toggle = document.querySelector(".hero-video-toggle");
const reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
if (!reduce) video.play().catch(() => {});
function syncLabel() {
toggle.textContent = video.paused ? "Play background video" : "Pause background video";
}
toggle.addEventListener("click", () => {
if (video.paused) video.play();
else video.pause();
});
video.addEventListener("play", syncLabel);
video.addEventListener("pause", syncLabel);
syncLabel();What WCAG says
Three WCAG 2.2 success criteria deal with motion. They are often blurred together, so here is the exact wording.
2.3.3 Animation from Interactions (Level AAA): Motion animation triggered by interaction can be disabled, unless the animation is essential to the functionality or the information being conveyed.
WCAG defines motion animation as the "addition of steps between conditions to create the illusion of movement or to give a sense of a smooth transition." This criterion covers motion that happens because the user did something, such as scrolling, clicking or hovering. It is Level AAA, so it is not part of the AA level most policies and contracts reference, but the W3C lists the prefers-reduced-motion query, in CSS (technique C39) and in JavaScript (SCR40), among its sufficient techniques for it.
2.2.2 Pause, Stop, Hide (Level A), first part. Moving, blinking, scrolling: For any 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 is a mechanism for the user to pause, stop, or hide it unless the movement, blinking, or scrolling is part of an activity where it is essential; and …
The criterion also covers auto-updating content. Note that it applies to everyone, not only to people who have set reduce. Respecting the media query does not satisfy it on its own: a carousel, ticker or looping animation that meets those three conditions needs a visible pause or stop control, or it has to stop within five seconds.
2.3.1 Three Flashes or Below Threshold (Level A): Web pages do not contain anything that flashes more than three times in any one second period, or the flash is below the general flash and red flash thresholds.
Flashing is a seizure risk, not a comfort issue, and no user setting makes it acceptable. Fast vibrate and blink effects and rapidly alternating colors are the things to check in UI animation.
Testing reduced motion
- Turn the operating system setting on and use the site normally. Browsers pick up the change without a restart.
- In Chrome or Edge DevTools, open the Rendering panel and set Emulate CSS media feature prefers-reduced-motion to reduce.
- In Firefox, add a number preference called ui.prefersReducedMotion in about:config and set it to 1.
- In Playwright tests, call page.emulateMedia({ reducedMotion: "reduce" }) and assert that parallax or autoplay is off.
- Check what remains: page transitions, modals, toasts, hover effects, scroll-triggered reveals, carousels, video, and third-party widgets such as chat launchers.
Reduced motion in the GradientDeck animation generator
The animation generator checks the setting itself. With reduced motion on, the preview does not play when the page loads; it plays when you change a setting or press restart, because then you have asked to see it. In the curated collection below, cards stay still until you press their restart button.
The copied code is a @keyframes rule and a class, with no reduced-motion handling, so add it for each animation you use. For entrances, swap the moving keyframes for a fade; for attention effects such as shake, vibrate and jello, consider removing them entirely under reduce and relying on color or text to signal the problem.
/* Copied from GradientDeck (your values may differ) */
.slide-in-left {
animation: slide-in-left 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0s 1 normal both;
}
/* Added: keep the arrival, drop the travel */
@media (prefers-reduced-motion: reduce) {
.slide-in-left {
animation: fade-in 0.2s linear both;
}
}
@keyframes fade-in {
from { opacity: 0; }
}For how the animation properties themselves work, see Writing CSS keyframe animations. For reduced motion in React components, the Motion icons article applies the same ideas to SVG.
References
W3C: Understanding SC 2.3.3 Animation from Interactions
W3C: Understanding SC 2.2.2 Pause, Stop, Hide
W3C: Understanding SC 2.3.1 Three Flashes or Below Threshold