Tiny(~1kB) animation hooks for React, built on Web Animations API.
Update description.
Full Changelog: https://github.com/inokawa/react-animatable/compare/0.13.1...0.13.2
Full Changelog: https://github.com/inokawa/react-animatable/compare/0.13.0...0.13.1
useAnimation
and useAnimationFunction
to be able to pass some argument when play.const animate = useAnimation<{ x: number; y: number }>(
(prev, args) => [
{ transform: prev.transform },
{ transform: `translate(${args.x}px, ${args.y}px)` },
],
{
duration: 400,
easing: "ease-in-out",
}
);
useEffect(() => {
animate.play({ args: { x: 100, y: 200 } });
}, [])
useAnimationController
hook and persist
method in favor of prev
and args
functionality of useAnimation
.AnimationGroup
to TransitionGroup
Full Changelog: https://github.com/inokawa/react-animatable/compare/0.12.1...0.13.0
Support Next.js and SSR.
Full Changelog: https://github.com/inokawa/react-animatable/compare/0.12.0...0.12.1
BREAKING: ref field was remove from AnimationHandle
and AnimationController
type. Just pass them directly to target element!
const animate = useAnimation(...);
return <div ref={animate}>...</div>
Full Changelog: https://github.com/inokawa/react-animatable/compare/0.11.1...0.12.0
Improve build setting
Full Changelog: https://github.com/inokawa/react-animatable/compare/0.11.0...0.11.1
react/jsx-runtime
error.Full Changelog: https://github.com/inokawa/react-animatable/compare/0.10.2...0.10.3
Full Changelog: https://github.com/inokawa/react-animatable/compare/0.10.1...0.10.2
Full Changelog: https://github.com/inokawa/react-animatable/compare/0.10.0...0.10.1