Animations
Create beautiful, performant animations for modern web applications using React, Motion, and CSS.
Animations enhance user experience by providing visual feedback, guiding attention, and creating delightful interactions. This guide provides practical examples and best practices for implementing animations in Next.js applications.
Smooth number transitions with NumberFlow for counters, statistics, and progress indicators. Perfect for dashboards and data visualizations.
Delightful icon animations using Motion (Framer Motion) for scale, rotation, and state changes. Add personality to your interface interactions.
Animate layout changes automatically when items are added, removed, or reordered. Perfect for dynamic lists and grids.
Lightweight CSS animations for hover effects, loading states, and transitions. No JavaScript required for simple animations.
Animation Principles
Use appropriate durations (200-300ms for micro-interactions) and easing functions for natural motion.
Every animation should serve a clear functional purpose: feedback, guidance, or delight.
Optimize for 60fps using transform and opacity. Avoid animating layout properties like width or height.
Respect user preferences for reduced motion using the prefers-reduced-motion media query.
Best Practices
Use transform and opacity for smooth 60fps animations
Avoid animating layout properties (width, height, top)
Use will-change sparingly and remove after animation
Test performance on lower-end devices
Keep animations under 300ms for micro-interactions
Use easing functions (ease-out, ease-in-out) for natural motion
Respect prefers-reduced-motion for accessibility
Provide meaningful feedback for user actions