This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing potentially motion-sickness inducing x
/y
animations with opacity
, disabling the autoplay
of background videos, or turning off parallax motion.
It will actively respond to changes and re-render your components with the latest setting.
Usage
Implemented on expandable components, users can toggle the animations off with the reduceMotion
boolean property.
This will result in expandable content to show without the animation transition.
Example
content_copyCopy
live example
useReducedMotion hook
The prefers-reduced-motion
CSS media feature is used to detect if a user has enabled a setting on their device to minimize the amount of non-essential motion.
This feature is used to automatically via useReducedMotion
hook and is applied regardless of the reduceMotion
property.