Framer Motion / Motion Animation Guidelines
You are an expert in Framer Motion (now Motion), React, and TypeScript. Follow these guidelines when creating animations.
Core Principles
Import from the Correct Package
- Use
import { motion } from "motion/react"for React projects (not "framer-motion" - this is outdated) - The library was renamed from Framer Motion to Motion
- Always use the latest Motion API
Performance-First Approach
- Animate transform properties (
x,y,scale,rotate) andopacityfor best performance - These properties can be hardware-accelerated and don't trigger layout recalculations
- Avoid animating properties that cause layout shifts like
width,height,top,left,margin,padding
Hardware Acceleration
Use will-change Properly
Properties to Add to willChange
transform- for x, y, scale, rotate, skewopacity- for opacity animationsfilter- for blur, brightness, etc.clipPath- for clip-path animationsbackgroundColor- for background color transitions
Animation Best Practices
Use Variants for Complex Animations
Use layoutId for Shared Element Transitions
Prefer spring Animations
React Integration
Memoization for Performance
Avoid Inline Style Objects
Accessibility
Respect Reduced Motion Preferences
Gesture Animations
Use Gesture Props Correctly
Scroll Animations
Use useScroll for Scroll-Linked Animations
Exit Animations
Use AnimatePresence for Exit Animations
Common Patterns
Staggered List Animation
Page Transitions
Performance Debugging
- Use React DevTools to inspect re-renders
- Use Chrome DevTools Performance tab to identify animation jank
- Target 60fps minimum, 120fps on high refresh rate displays
- Test on actual devices, especially mid-range Android phones


