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

[feat]: skipAnimation at the component level

Open josh-signal opened this issue 2 years ago • 0 comments

A clear and concise description of what the feature is

skipAnimation currently exists at the Global level which is very useful when used with useReducedMotion to be a good a11y citizen. But what if there are animations we don't want skipped regardless of user preference? Currently we can only block all animations or allow all and selectively block a few. This feature would allow one to maintain skipping animations for folks with reduced motion turned on but allow you to selectively allow certain animations to proceed.

Why should this feature be included?

The alternative is to selectively block animations. In a large codebase where many animations can exist this is not only cumbersome but also exposes the developers to shipping a poor a11y experience by forgetting to check reduced motion setting for new animations added.

Please provide an example for how this would work

// when the property exists and it's set to false the animation will not be skipped regardless of the global setting.
useSpring({ skipAnimation: false }); 

josh-signal avatar Sep 19 '22 20:09 josh-signal