Agent skill

framer-motion-interactive-animation

Framer Motion animations: motion components, gestures (hover/tap), entrance/exit, scroll triggers, and performance. Keywords: "animate", "animation", "framer motion", "hover", "scroll", "whileHover", "AnimatePresence"

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/framer-motion-interactive-animation

SKILL.md

Framer Motion Interactive Animation

motion Component

Convert any element to animatable:

```tsx 'use client';

import { motion } from 'framer-motion';

<motion.div animate={{ x: 100 }} transition={{ duration: 0.5 }} /> ```

Gesture Animations

Hover/Tap Effects

```tsx <motion.button whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }} transition={{ duration: 0.2 }}

Click Me </motion.button> ```

Entrance Animations

```tsx <motion.div initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.5 }}

Fades in and slides up </motion.div> ```

Exit Animations

CRITICAL: Must wrap in `<AnimatePresence>`

```tsx import { motion, AnimatePresence } from 'framer-motion';

Scroll-Triggered Animations

```tsx <motion.div initial={{ opacity: 0, y: 50 }} whileInView={{ opacity: 1, y: 0 }} viewport={{ once: true }} // Only animate once transition={{ duration: 0.6 }}

Appears when scrolled into view </motion.div> ```

Transition Options

```tsx // Spring (physics-based) transition={{ type: "spring", stiffness: 300, damping: 30 }}

// Tween (duration-based) transition={{ duration: 0.3, ease: "easeInOut" }} ```

Performance Best Practices

Animate: `transform` (x, y, scale, rotate), `opacity` ❌ Don't animate: width, height, margin, padding (causes reflow)

✅ Use `viewport={{ once: true }}` for scroll animations ❌ Forget `<AnimatePresence>` for exit animations


Token Estimate: ~2,200 tokens

Didn't find tool you were looking for?

Be as detailed as possible for better results