A lightweight React animation library for beautiful micro-interactions. Add professional motion to your UI with minimal code.
- Simple API β Intuitive components that just work
- Production Ready β Optimized for performance
- TypeScript First β Fully typed for better DX
- Zero Config β Works with any React setup
- Tiny Bundle β Minimal dependencies
npm install motionkit @react-spring/web @use-gesture/reactimport { TiltCard, BounceButton } from "motionkit";
function App() {
return (
<div>
<TiltCard>
<h1>Hover me for 3D effect!</h1>
</TiltCard>
<BounceButton onClick={() => alert("Clicked!")}>Press me</BounceButton>
</div>
);
}TiltCard β 3D tilt effect on hover
<TiltCard maxTilt={15} scale={1.05}>
<YourContent />
</TiltCard>BounceButton β Satisfying press animation
<BounceButton scale={0.95} onClick={handleClick}>
Click me
</BounceButton>RippleButton β Material-style ripple feedback
<RippleButton rippleColor="rgba(255,255,255,0.6)">Ripple</RippleButton>DraggableItem β Physics-based dragging
<DraggableItem bounds={{ left: 0, right: 300 }}>Drag me around</DraggableItem>FadeInSection β Animate on scroll into view
<FadeInSection direction="up" distance={50}>
I appear when you scroll to me
</FadeInSection>ParallaxContainer β Smooth parallax scrolling
<ParallaxContainer speed={0.5}>
<YourContent />
</ParallaxContainer>ShakeOnError β Shake animation for errors
<ShakeOnError trigger={hasError}>
<input />
</ShakeOnError>Toast β Notification system
<ToastProvider>
<YourApp />
</ToastProvider>MotionKit includes ready-to-use visual effects:
- 3DRotatingCarousel β Image carousel with 3D rotation
- AnimatedChart β Smooth chart animations
- ConfettiCannon β Celebration effects
- GlassCard β Glassmorphism card
- HolographicCard β Holographic shimmer effect
- MatrixRain β Matrix-style falling characters
- MusicVisualizer β Audio visualization
- ParticleField β Particle system
- VoiceVisualizer β Voice input visualization
Build your own animations with composable hooks:
import { useTilt, useParallax, useVisibility } from "motionkit";
// 3D tilt effect
const { tiltRef, style } = useTilt({ maxTilt: 20 });
// Parallax scrolling
const { ref, style } = useParallax({ speed: 0.3 });
// Scroll-triggered visibility
const [ref, springs] = useVisibility({ direction: "up" });Works seamlessly with any styling approach:
// Tailwind CSS
<TiltCard className="p-6 rounded-xl shadow-lg bg-white" />
// CSS Modules
<BounceButton className={styles.myButton} />
// Inline styles
<DraggableItem style={{ width: 200, height: 200 }} />Full type safety included:
import type { TiltCardProps, BounceButtonProps } from "motionkit";Run the example app to see all components in action:
git clone https://github.com/yourusername/motionkit.git
cd motionkit
npm install
npm run dev:example- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Use
will-change: transformfor heavy animations - Avoid animating too many elements simultaneously
- Set bounds on draggable items to limit calculations
We welcome contributions! Please read our Contributing Guide to get started.
git clone https://github.com/yourusername/motionkit.git
cd motionkit
npm install
npm run dev
npm run build:libMIT Β© Gowsi S M
Built with:
- React Spring β Animation engine
- use-gesture β Gesture handling
- TypeScript β Type safety
- Vite β Build tooling
Made with β€οΈ for developers who care about motion and UX
Documentation β’ Examples β’ NPM β’ GitHub