Overview
TheuseReducedMotion() hook returns a boolean indicating whether the user has enabled reduced motion preferences on their device. This allows you to create accessible animations that respect user preferences for motion.
Import
Usage
Return Value
Returns
true if the user has enabled reduced motion in their system preferences, false otherwise.Examples
Conditional Animation Type
Replace motion-intensive animations with simpler alternatives:Disable Autoplay
Disable autoplay features that might cause motion sickness:Adjust Animation Duration
Reduce animation duration for users with motion sensitivity:Behavior
- The hook reads the user’s
prefers-reduced-motionmedia query preference - Returns
truewhen the media query matchesreduce - Returns
falsewhen the media query matchesno-preference - Initializes lazily on first use for optimal performance
- Currently returns the initial state and does not respond to live changes
Accessibility
Best Practices
Replace movement animations
Replace movement animations
For users with motion sensitivity, replace
x, y, rotate, and scale animations with opacity fades or instant state changes.Maintain functional clarity
Maintain functional clarity
Even with reduced motion, ensure that state changes are still visually clear. Use opacity, color changes, or other non-motion cues.
Test with system settings
Test with system settings
Enable “Reduce Motion” in your OS accessibility settings to test the user experience:
- macOS: System Preferences → Accessibility → Display → Reduce motion
- iOS: Settings → Accessibility → Motion → Reduce Motion
- Windows: Settings → Ease of Access → Display → Show animations
Related
MotionConfig
Configure reduced motion globally
Accessibility Guide
Learn more about accessible animations