rive-react
rive-react copied to clipboard
Support listening to prefers-reduced-motion setting
Addresses issue raised in #152
- Adds the
usePrefersReducedMotionoption that can be passed to theuseRive. If true, we respect the user prefers-reduced-motion setting and start the animation paused. Defaults to false. - Adds the
usePrefersReducedMotionoption that can be passed to theRivecomponent, which get's passed onto the useRive hook.
A somewhat simple, dumb implementation right now where we just pause the animation on the first frame. Being able to select the specific frame to pause on would be a cool addition, but will require work on the wasm runtime, so we can look at that separately.