What problem does it solve?
This Skill helps prevent janky, inefficient, and unstable Framer Motion animations by enforcing performance-first patterns that reduce re-renders, bundle size, layout thrashing, and scroll/gesture stutter.
Core Features & Use Cases
- Performance & bundle optimization: prefers
LazyMotion, m components, and minimal feature bundles to reduce initial payload.
- Re-render prevention for animation stability: uses Motion Values, stable callbacks, memoized variants, and stable animate inputs to avoid animation restarts.
- Smooth visual rendering: prioritizes GPU-friendly properties like
transform, opacity, and filter, and avoids paint-triggering animations.
- Layout and shared transitions that scale: applies
layout, layoutDependency, LayoutGroup, layoutId, and layoutScroll to keep FLIP-based transitions correct in complex UIs.
- Scroll and gesture correctness: uses
useScroll, useSpring, scroll offsets/targets, and gesture props like whileHover/whileTap for responsive interactions.
- SVG animation quality: recommends motion-specific SVG components and techniques such as
pathLength and point-count matching for morphing.
Quick Start
Use framer-motion-best-practices to refactor the React Framer Motion code in your component for smoother animations and fewer re-renders.