Back to Skills

framer-motion

Expert guidelines for building performant animations with Framer Motion/Motion library in React applications

190stars30forksUpdated 7/16/2026

Security Assessment

Safe(100/100)
Security Score100/100

About framer-motion

The framer-motion skill provides expert guidelines for building performant animations with the Framer Motion / Motion library in React and TypeScript applications. It solves the problem of writing animations that stay smooth and maintainable by codifying best practices around correct imports, hardware acceleration, variants, gestures, scroll effects, exit animations, and accessibility. Notably it emphasizes that the library was renamed from Framer Motion to Motion, so imports should use "motion/react" rather than the outdated "framer-motion".

The guidelines take a performance-first approach: animate transform properties (x, y, scale, rotate) and opacity because they can be hardware-accelerated and don't trigger layout recalculations, and avoid animating layout-shifting properties like width, height, top, left, margin, and padding. It shows how to use will-change properly for transform, opacity, filter, clipPath, and backgroundColor, how to define variants for complex and staggered animations, layoutId for shared element transitions, and spring transitions with stiffness and damping for natural motion. React integration tips include memoizing variants with useMemo, memoizing callbacks with useCallback, and avoiding inline style objects that create new objects on every render. Additional sections cover gesture props (whileHover, whileTap), scroll-linked animations with useScroll and useTransform, exit animations with AnimatePresence, and page transition patterns.

This skill targets React developers building animated interfaces who want smooth, accessible motion. It stresses respecting reduced motion preferences via the useReducedMotion hook, disabling or shortening animations when a user prefers reduced motion. For performance debugging it recommends React DevTools to inspect re-renders, the Chrome DevTools Performance tab to identify jank, targeting 60fps minimum (120fps on high refresh displays), and testing on actual devices, especially mid-range Android phones. The skill is a set of code-backed guidelines rather than an automated tool.

FAQ

Which package should I import from?

Use import { motion } from "motion/react" for React projects. The library was renamed from Framer Motion to Motion, so "framer-motion" is outdated.

Which properties are best to animate for performance?

Animate transform properties (x, y, scale, rotate) and opacity, since they can be hardware-accelerated and don't trigger layout recalculations. Avoid animating width, height, top, left, margin, and padding, which cause layout shifts.

How does the skill handle accessibility?

It recommends respecting reduced motion preferences using the useReducedMotion hook from motion/react, setting animation values and durations to 0 when the user prefers reduced motion.

What React performance practices are recommended?

Memoize animation variants with useMemo, memoize callbacks with useCallback, and avoid inline style objects that create a new object on every render by defining styles outside the component or memoizing them.

How should I debug animation performance?

Use React DevTools to inspect re-renders and the Chrome DevTools Performance tab to identify jank. Target 60fps minimum (120fps on high refresh rate displays) and test on real devices, especially mid-range Android phones.

Install framer-motion

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill