framer-motion

Optimize Framer Motion animation performance in React applications.

8|Updated Aug 25, 2020
One-click install
npx skills add https://github.com/braswelljr/braswelljr --skill framer-motion-braswelljr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: framer-motion
Source: https://github.com/braswelljr/braswelljr/tree/main/.agents/skills/framer-motion
Command: npx skills add https://github.com/braswelljr/braswelljr --skill framer-motion-braswelljr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

Framer Motion animations can cause performance bottlenecks including large bundle sizes, unnecessary React re-renders, and janky frame rates. This skill provides 42 prioritized rules to optimize animation performance and ensure smooth 60fps experiences.

Core Features & Use Cases

  • 42 Performance Rules: Organized into 9 categories by impact level (CRITICAL, HIGH, MEDIUM, LOW) covering bundle optimization, re-render prevention, animation properties, layout animations, scroll animations, gesture optimization, spring physics, SVG animations, and exit animations.
  • Code Examples: Each rule includes incorrect and correct code patterns with detailed explanations.
  • Use Cases: Writing new Framer Motion animations, reviewing existing animation code, refactoring animation-heavy React components, and reducing bundle size for production applications.

Quick Start

Use the framer-motion skill to review your React animation code and apply the bundle-lazy-motion and rerender-motion-value rules to improve performance.

Frequently Asked Questions about framer-motion

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize Framer Motion animations in React to prevent re-renders?

Optimize Framer Motion animations in React by enforcing GPU-accelerated properties and isolating motion values to prevent re-renders. This skill delivers 42 rules across 9 categories to eliminate unnecessary React re-renders and maintain smooth 60fps experiences.

What is the best way to reduce Framer Motion bundle size in a React application?

The best way to reduce Framer Motion bundle size is applying bundle-lazy-motion patterns. This skill provides correct code examples and categorized rules for bundle optimization, ensuring you ship smaller production applications without sacrificing animation capabilities.

Why does my Framer Motion layout animation cause janky frame rates in React?

Framer Motion layout animations cause janky frame rates when using non-GPU-accelerated properties or triggering unnecessary re-renders. This skill identifies incorrect code patterns and enforces GPU-accelerated properties to maintain smooth 60fps during layout transitions.

Can I use this skill to review and refactor existing React animation code?

Yes, you can use this skill to review and refactor existing React animation code. It supports development, review, and refactoring tasks by providing incorrect and correct code patterns with detailed explanations for refactoring animation-heavy components.

Do I need React and Framer Motion expertise to use these animation performance rules?

Yes, you need React and Framer Motion expertise to implement these animation performance rules. The 42 prioritized rules include code examples requiring foundational framework knowledge to effectively apply bundle optimization and re-render prevention techniques.

How do I optimize scroll-linked effects and SVG animations with Framer Motion?

To optimize scroll-linked effects and SVG animations with Framer Motion, apply the medium and low impact rules provided here. These rules cover scroll animations and SVG animations with correct code patterns to maintain performance and reduce frame drops.