rive-react icon indicating copy to clipboard operation
rive-react copied to clipboard

Support listening to prefers-reduced-motion setting

Open avivian opened this issue 2 years ago • 0 comments

Addresses issue raised in #152

  • Adds the usePrefersReducedMotion option that can be passed to the useRive. If true, we respect the user prefers-reduced-motion setting and start the animation paused. Defaults to false.
  • Adds the usePrefersReducedMotion option that can be passed to the Rive component, 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.

avivian avatar Mar 17 '23 10:03 avivian