How to install framer-motion
npx skills add https://github.com/pproenca/dot-skills --skill framer-motionFull instructions (SKILL.md)
Source of truth, from pproenca/dot-skills.
name: framer-motion description: Framer Motion performance optimization guidelines. This skill should be used when writing, reviewing, or refactoring React animations with Framer Motion to ensure optimal performance patterns. Triggers on tasks involving motion components, animations, gestures, layout transitions, scroll-linked effects, and SVG animations.
Community Framer Motion Best Practices
Comprehensive performance optimization guide for Framer Motion animations in React applications. Contains 42 rules across 9 categories, prioritized by impact to guide automated refactoring and code generation.
When to Apply
Reference these guidelines when:
- Adding animations to React components with Framer Motion
- Optimizing bundle size for animation-heavy applications
- Preventing unnecessary re-renders during animations
- Implementing layout transitions or shared element animations
- Building scroll-linked or gesture-based interactions
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Bundle Optimization | CRITICAL | bundle- |
| 2 | Re-render Prevention | CRITICAL | rerender- |
| 3 | Animation Properties | HIGH | anim- |
| 4 | Layout Animations | HIGH | layout- |
| 5 | Scroll Animations | MEDIUM-HIGH | scroll- |
| 6 | Gesture Optimization | MEDIUM | gesture- |
| 7 | Spring & Physics | MEDIUM | spring- |
| 8 | SVG & Path Animations | LOW-MEDIUM | svg- |
| 9 | Exit Animations | LOW | exit- |
Quick Reference
1. Bundle Optimization (CRITICAL)
bundle-lazy-motion- Use LazyMotion and m component instead of motionbundle-dynamic-features- Dynamically import motion featuresbundle-dom-animation- Use domAnimation for basic animationsbundle-use-animate-mini- Use mini useAnimate for simple casesbundle-strict-mode- Enable strict mode to catch accidental imports
2. Re-render Prevention (CRITICAL)
rerender-motion-value- Use useMotionValue instead of useStatererender-use-transform- Derive values with useTransformrerender-stable-callbacks- Keep animation callbacks stablererender-variants-object- Define variants outside componentrerender-animate-prop- Use stable animate valuesrerender-motion-value-event- Use motion value events
3. Animation Properties (HIGH)
anim-transform-properties- Animate transform propertiesanim-opacity-filter- Prefer opacity and filter for visual effectsanim-hardware-acceleration- Leverage hardware accelerationanim-will-change- Use willChange prop judiciouslyanim-independent-transforms- Animate transforms independentlyanim-keyframes-array- Use keyframe arrays for sequences
4. Layout Animations (HIGH)
layout-dependency- Use layoutDependency to limit measurementslayout-position-size- Use layout="position" or "size" appropriatelylayout-group- Group related layout animationslayout-id-shared- Use layoutId for shared element transitionslayout-scroll- Add layoutScroll to scrollable ancestors
5. Scroll Animations (MEDIUM-HIGH)
scroll-use-scroll- Use useScroll hook for scroll-linked animationsscroll-use-spring-smooth- Smooth scroll animations with useSpringscroll-element-tracking- Track specific elements entering viewportscroll-offset-configuration- Configure scroll offsetsscroll-container-ref- Track scroll within specific containers
6. Gesture Optimization (MEDIUM)
gesture-while-props- Use whileHover/whileTap instead of handlersgesture-variants-flow- Let gesture variants flow to childrengesture-drag-constraints- Use dragConstraints ref for boundariesgesture-drag-elastic- Configure dragElastic for natural feelgesture-tap-cancel- Use onTapCancel for interrupted gestures
7. Spring & Physics (MEDIUM)
spring-physics-based- Use physics-based springs for interruptibilityspring-damping-ratio- Configure damping to control oscillationspring-mass-inertia- Adjust mass for heavier/lighter feelspring-use-spring-hook- Use useSpring for reactive values
8. SVG & Path Animations (LOW-MEDIUM)
svg-path-length- Use pathLength for line drawing animationssvg-motion-components- Use motion.path and motion.circlesvg-viewbox-animation- Animate viewBox for zoom effectssvg-morph-matching-points- Match point counts for morphing
9. Exit Animations (LOW)
exit-animate-presence- Wrap conditional renders with AnimatePresenceexit-unique-keys- Provide unique keys for AnimatePresence childrenexit-mode-wait- Use mode="wait" for sequential transitions
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
Reference Files
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
Related skills
More from pproenca/dot-skills and the wider catalog.

nuqs
nuqs (type-safe URL query state) best practices for Next.js and other React frameworks. This skill should be used when writing, reviewing, or refactoring code that uses nuqs for URL state management. Triggers on tasks involving useQueryState, useQueryStates, search params, URL state, query parameters, nuqs parsers, limitUrlUpdates, Standard Schema, NuqsAdapter, or Next.js routing with state.

react-hook-form
Performance optimization guide for React Hook Form client-side forms with 45 rules across 8 categories.

react-refactor
Architectural refactoring guide for React applications covering component architecture, state architecture, hook patterns, component decomposition, coupling and cohesion, data flow, and refactoring safety. Use when refactoring React codebases, reviewing PRs for architectural issues, decomposing oversized components, or improving module boundaries. Does NOT cover React 19 API usage (see react skill) or performance optimization (see react-optimise skill).

shadcn
shadcn/ui component library best practices and patterns (formerly shadcn-ui). This skill should be used when writing, reviewing, or refactoring shadcn/ui components to ensure proper architecture, accessibility, and performance. Triggers on tasks involving Radix primitives, Tailwind styling, form validation with React Hook Form, data tables, theming, or component composition patterns.

terminal-ui
Terminal User Interface (TUI) performance and UX guidelines for TypeScript applications using Ink and Clack. This skill should be used when building CLI tools, interactive terminal prompts, or developer tooling with TUI components. Triggers on tasks involving TUI components, CLI prompts, terminal rendering, keyboard input handling, or developer tooling.

typescript
TypeScript performance, tsconfig, type errors, async patterns — triggered when the user asks to "optimize TypeScript performance", "speed up tsc compilation", "configure tsconfig.json", "fix type errors", "improve async patterns", or encounters TS errors (TS2322, TS2339, "is not assignable to"). Also triggers on .ts, .tsx, .d.ts file work involving type definitions, module organization, or memory management. Does NOT cover TypeScript basics, framework-specific patterns, or testing.