framer-motion
Skill3 starsChanged 7 months agoMITView on GitHub
This skill should be used when the user asks to "add animations", "implement transitions", "create gesture interactions", "build layout animations", "add scroll-based effects", or mentions "framer motion", "motion", "animate", "animation", "transition", "gesture", "layout animation", "scroll animation", "variants", "AnimatePresence". Provides Framer Motion animation library expertise for React/Next.js including gestures, layout animations, exit animations, and scroll-driven effects.
11 other projects use a version of this.
Adopted by
Most recently taken up by
- OpenMontageInc/OpenMontagetheir own version, first seen Nov 8, 2026
- calesthio/OpenMontagetheir own version, first seen Nov 8, 2026
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- jwuthri-cloud/Tracely-aitheir own version, first seen Oct 20, 2026
- Gopyr/gopyr-skills-hubtheir own version, first seen Oct 11, 2026
- Mindrally/skillstheir own version, first seen Oct 8, 2026
Used with
Projects with it also use canvas-procedural-animation, svg-character-animation and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
LinHao-citySkillcanvas-procedural-animation
Use p5.js/canvas for local procedural character effects: particles, weather, squash/stretch, walk cycles, and environmental motion.
Also in 4 projects that use this
LinHao-citySkillsvg-character-animation
Animate SVG character rigs with GSAP, CSS transforms, Remotion frame control, and HyperFrames-compatible browser previews.
Also in 4 projects that use this
JwuthriSkillcanvas-generative
Algorithmic and generative art with Canvas 2D - particles, flow fields, noise, fractals, L-systems.
Also in 3 projects that use this
JwuthriSkillcompose-graphics
Advanced Compose visuals - Material 3 Expressive motion physics, AGSL shaders (Android 13+), Canvas/DrawScope generative, graphicsLayer effects.
Also in 3 projects that use this
- +5 more from Jwuthri
- +3 more from LinHao-city
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- calesthio/OpenMontage★ 78ksame name
- OpenMontageInc/OpenMontage★ 78ksame name
- Jwuthri/Tracely-ai★ 1.3ksame name
- jwuthri-cloud/Tracely-ai★ 979same name
- AThevon/genjutsu★ 758same name
- Mindrally/skills★ 275same name
- LinHao-city/StoryMind★ 10same name
- alexsnchz/skills★ 0same name
- andfrancot-alt/claude-skills★ 0same name
- davidanthonyn/claude-skills★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- api-designSkill
- auth-patternsSkill
- database-designerSkill
- database-optimizerSkill
- js-debuggingSkill
- js-testingSkill
- knip-cleanupSkill
- mysql-expertSkill
- nextjs-expertSkill
- nextjs-typescript-engineerSkill
- postgresql-expertSkill
- prisma-ormSkill
- quality-gateSkill
- supabaseSkill
- tailwindSkill
- verificationSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Never import from 'framer-motion' — that is the old package name.
- Very specific: line 100
Use whileHover and whileTap instead of CSS :hover/:active when the animation needs spring physics or must compose with other motion states.
- Very specific: line 142
Use useMotionValueEvent to run side effects (e.g., toggling a class) on scroll progress without triggering React re-renders.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Framer Motion Skill
You are a Framer Motion expert for React and Next.js applications.
Critical Rules
- Always add
'use client'—motioncomponents use browser APIs and cannot run in Server Components. Any file usingmotion.*,AnimatePresence,useScroll,useMotionValue, oruseAnimatemust declare'use client'at the top. - Import from
motion/react— The package was renamed. The correct import is:
Never import fromimport { motion, AnimatePresence } from 'motion/react''framer-motion'— that is the old package name. - Prefer CSS for trivial animations — If the animation is simple opacity or transform with no interactivity, use CSS transitions. Reserve
motionfor interactive gestures, staggered sequences, layout animations, and exit animations. - Use
layoutIdfor shared layout transitions — When an element moves between positions or DOM locations (e.g., a selected card expanding, a tab indicator sliding), assign matchinglayoutIdprops. Framer Motion handles the FLIP animation automatically. - Wrap exit animations with
AnimatePresence— Theexitprop on amotioncomponent only fires when the component is removed from the tree and it is a direct child ofAnimatePresence. Without the wrapper, exit animations are silently skipped. - Respect
prefers-reduced-motion— CheckuseReducedMotion()and substitute instant transitions or no animation for users who have opted out of motion. Never force animation on users with vestibular disorders.
Core API
Basic Animation
'use client'
import { motion } from 'motion/react'
// Animate on mount
<motion.div
initial={{ opacity: 0, y: 16 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.3, ease: 'easeOut' }}
/>
// Named variants (preferred for reuse and orchestration)
const variants = {
hidden: { opacity: 0, y: 16 },
visible: { opacity: 1, y: 0 },
}
<motion.div variants={variants} initial="hidden" animate="visible" />Exit Animations
'use client'
import { motion, AnimatePresence } from 'motion/react'
<AnimatePresence>
{isVisible && (
<motion.div
key="panel"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
/>
)}
</AnimatePresence>AnimatePresence must be outside the conditional. The key prop must be stable.
Gesture Animations
<motion.button
whileHover={{ scale: 1.04 }}
whileTap={{ scale: 0.96 }}
transition={{ type: 'spring', stiffness: 400, damping: 20 }}
/>
// Draggable with constraints
<motion.div
drag
dragConstraints={{ left: 0, right: 300, top: 0, bottom: 300 }}
whileDrag={{ scale: 1.05, cursor: 'grabbing' }}
/>Use whileHover and whileTap instead of CSS :hover/:active when the animation needs spring physics or must compose with other motion states.
Layout Animations
// Automatic layout animation — wrap any element whose layout changes
<motion.div layout />
// Shared layout transition between two elements
// Card in list
<motion.div layoutId="card-42" />
// Card expanded to modal — same layoutId, Framer handles the transition
<motion.div layoutId="card-42" />Wrap layout-animated elements in <LayoutGroup> when they need to coordinate across component boundaries.
Scroll Animations
'use client'
import { useRef } from 'react'
import { motion, useScroll, useTransform } from 'motion/react'
export function ParallaxSection() {
const ref = useRef<HTMLDivElement>(null)
const { scrollYProgress } = useScroll({
target: ref,
offset: ['start end', 'end start'],
})
const y = useTransform(scrollYProgress, [0, 1], [60, -60])
return (
<div ref={ref}>
<motion.div style={{ y }} />
</div>
)
}Use useMotionValueEvent to run side effects (e.g., toggling a class) on scroll progress without triggering React re-renders.
Performance
- Animate only
transformandopacity— These are GPU-composited and do not trigger layout recalculation. Animatingwidth,height,top,left,margin, orpaddingcauses layout thrash. - Add
will-change: transformvia Tailwind (will-change-transform) on elements that animate frequently, but remove it after the animation ends when possible. - Avoid animating too many elements simultaneously — Stagger children instead of animating them all at once.
- Use
layout="position"orlayout="size"instead oflayoutwhen only one axis changes, to limit layout measurement cost.
Anti-Patterns
| Anti-pattern | Fix |
Animating width/height directly | Use scale transform or layout prop instead |
Forgetting AnimatePresence for exit | Wrap conditionally rendered motion.* in AnimatePresence |
Using motion.* in a Server Component | Add 'use client' directive |
Importing from 'framer-motion' | Import from 'motion/react' |
Ignoring prefers-reduced-motion | Use useReducedMotion() and skip/reduce animations |
Applying layoutId to different element types | layoutId works best when both elements share the same tag |
For common animation recipes (fade, slide, stagger, spring, keyframes, path), see reference/animation-patterns.md.
For orchestration, imperative control, motion values, drag-to-reorder, and scroll-triggered reveals, see reference/advanced-patterns.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

