CSS prefers-reduced-motion Media Feature

Beginner
6 min read
Updated: Nov 2026
3 examples
Live preview

Definition and Usage

The prefers-reduced-motion media feature detects whether a user has asked their operating system to minimize non-essential motion.

Use it to replace large movement, zooming, parallax, and continuous animation with calmer transitions or instant state changes. Motion that communicates essential status can remain, but should be restrained.

Baseline · Widely available.

This preference query is designed for progressive enhancement. Browsers that do not support it keep the default styles.

Tip Start with a calm default

A motion-reduced experience should preserve the same content and actions. Do not remove information just because animation is disabled.

CSS Syntax

syntax.css
@media (prefers-reduced-motion:reduce | no-preference) { … }

Wrap the feature in parentheses and put the conditional CSS inside the media block.

Feature Values

ValueDescriptionTry it
reduceThe user asked the system to minimize non-essential motionTry it
no-preferenceThe user has not expressed a reduced-motion preferenceTry it

How to Use prefers-reduced-motion

Use the preference to enhance a solid, accessible default.

  1. Build the interface so it works without animation.
  2. Use @media (prefers-reduced-motion: reduce) to remove or simplify motion.
  3. Optionally add richer movement only inside no-preference.
  4. Test with the operating system’s reduced-motion setting enabled.
PieceRequired?Role
@mediaYesWraps the preference query
prefers-reduced-motionYesNames the media feature
Accessible defaultsYesWork when no query matches
Real-device testingRecommendedConfirms operating-system behavior

Live Preview

Your browser evaluates each prefers-reduced-motion value below through matchMedia.

Detected preference

Change the related operating-system accessibility or appearance setting, then recheck.

Preference detection
reduceno-preference

Checking…

CSS Examples

Each example keeps the default usable, then responds to prefers-reduced-motion. Open Try It Yourself for a live editor.

Example 1 — Disable a Large Animation

Turn a moving entrance into an instant, stable state.

CSS
.panel {
  animation: slide-in 500ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .panel {
    animation: none;
  }
}
Try It Yourself

How It Works

  1. The default rule provides an animated entrance.
  2. The preference query detects reduce.
  3. Setting animation: none removes the movement.
  4. The panel content and final layout stay unchanged.

Example 2 — Add Motion as an Enhancement

Keep the default static and animate only when no reduction is requested.

CSS
.badge {
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  .badge {
    animation: pulse 1.5s ease-in-out infinite alternate;
  }
}
Try It Yourself

How It Works

  1. The default badge is static.
  2. The query explicitly checks no-preference.
  3. Animation becomes an enhancement instead of a requirement.
  4. Users requesting less motion keep a stable badge.

Example 3 — Shorten Transitions

Replace a sweeping transition with a near-instant change.

CSS
.dialog {
  transition: transform 400ms ease, opacity 400ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .dialog {
    transition-duration: 0.01ms;
  }
}
Try It Yourself

How It Works

  1. The normal transition animates transform and opacity.
  2. The reduced-motion query keeps the state change.
  3. A tiny duration avoids visible movement.
  4. The same control remains available to everyone.

Edge Cases & Pitfalls

Reduced motion means less non-essential movement, not a feature-free page.

a11y

Do not remove meaning

Keep status, hierarchy, and feedback when motion is reduced.

default

Prefer calm defaults

A static default with motion inside no-preference is resilient.

vestibular

Avoid large spatial motion

Zoom, parallax, spinning, and sweeping movement can trigger discomfort.

test

Test the real setting

Enable reduced motion in Windows, macOS, iOS, or Android and reload the page.

Browser Support

prefers-reduced-motion is a browser media feature. Node.js, Deno, and Bun do not apply CSS media queries.

✓ Baseline · Widely available

prefers-reduced-motion

Supported across modern browsers since 2020.

97% Modern browsers
Google Chrome 74+
Full support
Mozilla Firefox 63+
Full support
Apple Safari 10.1+
Full support
Microsoft Edge 79+
Full support
Opera 62+
Full support
Samsung Internet 11.1+
Full support
Internet Explorer No
No support
@media (prefers-reduced-motion) Progressive enhancement

Bottom line: Safe for production as progressive enhancement. Keep a usable non-animated default.

Key Takeaways

  • Role: respond to a user’s prefers-reduced-motion setting.
  • Values: reduce, no-preference.
  • Default: keep the page accessible when the query is unsupported.
  • Test: use actual operating-system preference settings.

One line: use prefers-reduced-motion to respect user preferences without weakening the default experience.

Frequently Asked Questions

It detects whether the user has asked the operating system to minimize non-essential motion.
It accepts reduce and no-preference. The reduce value means less motion was requested.
No. Remove or simplify non-essential movement. Small motion that clearly communicates state may remain when it is not disruptive.
That is a strong progressive-enhancement pattern: ship a calm default, then add richer motion only when no preference to reduce it is expressed.
Enable the reduced-motion or animation setting in the operating system, then reload the page and inspect matchMedia('(prefers-reduced-motion: reduce)').matches.
CSS can apply styles directly, and JavaScript can observe the same query through window.matchMedia.

Next: prefers-color-scheme

Continue with the prefers-color-scheme media feature.

prefers-color-scheme tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful