A lightweight animation library for React. Built on top of the View Transitions API.
- 🎯 9 Pre-built Animations -> Slides, fades, scales, and flips
- 🚀 View Transitions API -> Leverages the modern browser API for smooth transitions
- 🎨 Customizable -> Configure duration, easing, and animation names
- 📦 Lightweight -> Minimal bundle size with zero dependencies
- 🔧 TypeScript Support -> Fully typed API
- 🔄 Graceful Fallback -> Works in browsers without View Transitions API support
- ⚡ Automatic CSS Injection -> No manual CSS imports needed
npm install @tigerabrodioss/eiwaal
import { useViewTransition } from "eiwaal";
function MyComponent() {
const [ref, startTransition] = useViewTransition({
name: "my-element",
animation: "fadeIn",
config: {
duration: 300,
easing: "ease-in-out",
},
});
const handleClick = () => {
startTransition(() => {
setContent("New content");
});
};
return (
<div ref={ref} onClick={handleClick}>
Click me to animate!
</div>
);
}
slideUp
| slideDown
| slideLeft
| slideRight
| fadeIn
| scaleIn
| fadeScale
| flipX
| flipY
Returns [ref, startTransition]
Options:
name
: string -> Unique identifieranimation
: AnimationType -> Animation to useconfig
: { duration: number, easing: string } -> Animation configuration (optional)
Component wrapper with the same options as props.
See the browsers that support the View Transitions API here.
MIT License.