Tutorials
prefers-reduced-motion: a practical guide to reducing motion without removing it
How prefers-reduced-motion works, how to test it on every OS and in Chrome DevTools, and patterns for CSS, JavaScript, Framer Motion and GSAP, with a checklist.
prefers-reduced-motion is a CSS media feature that tells you whether the person using the page has asked their operating system to cut down on animation. Some people get dizzy or nauseous from large movement on screen, especially parallax, zooms and slides. Others find constant motion distracting. Turning on "Reduce motion" is how they say so, and the browser passes that on to your code.
This guide covers what the setting means, how to test it on every major platform, and the patterns that work in CSS, plain JavaScript, Framer Motion and GSAP. The main idea is simple: reduce motion, do not delete it.
Your changes are live.
What the setting actually means
The media feature has two values. no-preference means the user has not asked for anything. reduce means they have turned on the system setting. There is no "none" value, and the name is a hint: the request is to reduce, not to remove.
Motion that causes problems is mostly vestibular: things that travel a long way, zoom, rotate, or move at a different speed from the scroll. A toast that slides 40 px is minor. A hero image that scales from 120% to 100% while the page scrolls is not. Fades, colour changes and small opacity shifts are generally safe, and they still tell people that something happened. Removing every transition can make an interface harder to follow, because state changes become sudden jumps.
How to turn it on for testing
The setting lives in the operating system, and every browser that supports the media query reads it from there.
- macOS: System Settings > Accessibility > Display > Reduce motion.
- Windows 11: Settings > Accessibility > Visual effects > Animation effects (turn it off). On Windows 10 it is Settings > Ease of Access > Display > Show animations in Windows.
- iOS and iPadOS: Settings > Accessibility > Motion > Reduce Motion.
- Android: Settings > Accessibility > Remove animations. The exact path varies by device maker; on some phones it sits under "Colour and motion" or "Visibility enhancements".
For day-to-day work you do not need to touch the OS. In Chrome DevTools, open the Command Menu (Cmd/Ctrl + Shift + P), type "reduced motion" and choose Emulate CSS prefers-reduced-motion: reduce. The same option is in the Rendering panel under Emulate CSS media feature prefers-reduced-motion. It applies to the current tab while DevTools is open, so you can flip between the two states quickly. In Firefox you can set ui.prefersReducedMotion to 1 in about:config.
If you are new to the DevTools side of animation, the guide to inspecting CSS animations in Chrome DevTools covers the Animations panel, which is useful here too: play the page with and without emulation and compare what each element does.
CSS: swap movement for a fade
The most useful pattern keeps the animation but changes what it animates. Here is the entrance from the demo above.
.toast { animation: toast-in 520ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes toast-in {
from { opacity: 0; transform: translateY(40px) scale(.9); }
to { opacity: 1; transform: none; }
}
@keyframes toast-fade {
from { opacity: 0; }
to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
.toast { animation: toast-fade 300ms ease-out both; }
}
Two details. The reduced version is shorter, because a fade does not need as long as a travel. And it keeps both as the fill mode, so the element still ends visible. If you set animation: none on an element whose resting state depends on the final keyframe, it can stay invisible.
For things that loop forever, such as a spinning background or an orbit of icons, stop the loop and leave the elements in a sensible static position. Loading spinners are a special case: they carry information, so keep them, but consider a slower speed or a pulsing opacity instead of a rotation.
Avoid the blanket reset that sets every animation and transition to 0.01ms with !important on *. It is a quick fix for an old codebase, but it also removes harmless fades and can break code that waits for animationend or transitionend at a predictable time.
The no-motion-first approach
Instead of adding motion and then taking it away, you can write the static styles first and add movement only when the user has no preference.
.card { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
.card { transition: transform 240ms cubic-bezier(.2, .8, .2, 1), box-shadow 240ms ease; }
.card:hover { transform: translateY(-4px); }
}
The advantage is that older browsers, which do not understand the media query, get the calm version. It also makes reviews easier: every movement sits in one clearly labelled block. The downside is that both the base and the motion styles need care so the hover still has some visible feedback, such as a shadow or border colour change outside the media query.
JavaScript: matchMedia and a change listener
Any animation you start from script needs to check the setting too. window.matchMedia gives you the current value and an event when it changes, which happens if someone turns the setting on while the page is open.
const query = window.matchMedia('(prefers-reduced-motion: reduce)');
let reduceMotion = query.matches;
query.addEventListener('change', (event) => {
reduceMotion = event.matches;
});
function revealPanel(panel) {
const keyframes = reduceMotion
? [{ opacity: 0 }, { opacity: 1 }]
: [{ opacity: 0, transform: 'translateY(24px)' }, { opacity: 1, transform: 'none' }];
panel.animate(keyframes, {
duration: reduceMotion ? 200 : 450,
easing: 'cubic-bezier(.2, .8, .2, 1)',
fill: 'both',
});
}
Very old Safari versions only support the deprecated addListener method on the media query list. If you need to support them, check for addEventListener first and fall back. The same check applies to scrollIntoView({ behavior: 'smooth' }) and window.scrollTo: pass 'auto' when the user prefers reduced motion. In CSS, wrap scroll-behavior: smooth in a no-preference query.
Framer Motion: useReducedMotion and MotionConfig
Framer Motion (now published as Motion for React) has two tools. The quick one is a single prop at the top of the app.
import { MotionConfig } from 'framer-motion';
export function App({ children }) {
return <MotionConfig reducedMotion="user">{children}</MotionConfig>;
}
With reducedMotion="user", transform and layout animations are disabled when the user has the setting on, while opacity and colour animations still run. That is the reduce-not-remove rule applied for you.
When you want a specific alternative, use the hook.
import { motion, useReducedMotion } from 'framer-motion';
export function Drawer({ open, children }) {
const reduce = useReducedMotion();
return (
<motion.aside
initial={false}
animate={open
? { opacity: 1, x: 0 }
: { opacity: 0, x: reduce ? 0 : -320 }}
transition={{ duration: reduce ? 0.2 : 0.4, ease: [0.2, 0.8, 0.2, 1] }}
>
{children}
</motion.aside>
);
}
If you are moving keyframes from CSS into Framer Motion, the CSS keyframes to Framer Motion guide shows how durations, easing and fill modes map.
GSAP: gsap.matchMedia()
GSAP has its own matchMedia helper that creates and reverts animations as conditions change, so you do not have to track the listener yourself.
const mm = gsap.matchMedia();
mm.add(
{
isReduced: '(prefers-reduced-motion: reduce)',
isFull: '(prefers-reduced-motion: no-preference)',
},
(context) => {
const { isReduced } = context.conditions;
gsap.from('.hero-line', {
opacity: 0,
y: isReduced ? 0 : 40,
duration: isReduced ? 0.3 : 0.8,
stagger: isReduced ? 0 : 0.08,
ease: 'power3.out',
});
}
);
When the setting changes, GSAP reverts everything created inside the callback and runs it again with the new conditions. Parallax and pinned scroll scenes built with ScrollTrigger belong inside the isFull branch only.
What WCAG says
- 2.3.3 Animation from Interactions (Level AAA): motion triggered by an interaction, such as scrolling or clicking, can be disabled unless it is essential. Respecting
prefers-reduced-motionis the usual way to meet it. - 2.2.2 Pause, Stop, Hide (Level A): anything that moves on its own for more than five seconds, alongside other content, needs a way to pause, stop or hide it. This applies to everyone, not only people with the setting on, so carousels, marquees and looping backgrounds need a visible pause control.
- 2.3.1 Three Flashes or Below Threshold (Level A): nothing should flash more than three times a second. That is a separate safety rule, and no user setting excuses it.
Auditing an existing site
On a large site the hard part is knowing what moves. Go page by page, play each interaction, and write down which properties change. Anything on transform, top/left, scale or scroll position is movement to reduce. opacity, color and filter changes can usually stay. For animations driven by JavaScript, which DevTools does not show, Capture Motion can record the element while it plays and list the keyframes, duration and easing of each animated property, so you can see exactly what needs a reduced version. The easing guide is worth a read too, since gentler curves make the full-motion version calmer for everyone.
Checklist
- Test with the setting on using DevTools emulation, then once on a real device.
- Replace travel, zoom and spin with fades for entrances, exits and page transitions.
- Stop parallax, autoplaying loops and scroll-linked movement entirely under
reduce. - Keep feedback: hover, focus and state changes still need a visible, non-moving cue.
- Check script-driven motion: Web Animations API, Framer Motion, GSAP, smooth scrolling and video autoplay.
- Listen for changes with a
changelistener orgsap.matchMedia(), not a one-off check. - Add a pause control to any motion that plays for longer than five seconds, whatever the setting.
Questions
Does prefers-reduced-motion mean I should remove all animation?
No. It means reduce the motion that moves things across the screen, scales or spins them. Opacity fades, colour changes and short state changes are usually fine and often help people understand what changed.
How do I test prefers-reduced-motion without changing my OS settings?
In Chrome DevTools open the Rendering panel and set Emulate CSS media feature prefers-reduced-motion to reduce. You can also run 'Emulate CSS prefers-reduced-motion: reduce' from the Command Menu. The emulation lasts while DevTools is open for that tab.
Is prefers-reduced-motion required by WCAG?
The media query itself is not named in WCAG, but it is the usual way to meet 2.3.3 Animation from Interactions (Level AAA). Level A 2.2.2 Pause, Stop, Hide applies to any auto-playing motion longer than five seconds, whatever the user's setting.
How can I see which properties an existing animation moves?
Open the Animations panel in Chrome DevTools for CSS animations, or record the animation with Capture Motion, which lists the keyframes, duration and easing of every animated property, including GSAP. That tells you which parts are movement to reduce and which are fades you can keep.
