framer-motion

A guide to adding interactive animation to React and Next.js interfaces with Motion, including transitions, gestures, layout changes, and scroll effects.

In plain words
What is it for?
Building interactive gestures, layout animations, shared-element transitions, exit animations, staggered sequences, and scroll-based effects.
Why use it?
It helps choose between simple CSS transitions and Motion features while avoiding common setup and component-removal mistakes.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/iwritec0de/app-dev/framer-motion
Any agent
npx skills add iwritec0de/app-dev --skill framer-motion
Clone the repo
git clone --depth 1 https://github.com/iwritec0de/app-dev

Made for: Claude Code, Codex.

Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,486 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00101 $0.01486
Opus 5 $0.00051 $0.00743
Sonnet 5 $0.00020 $0.00297
Haiku 4.5 $0.00010 $0.00149

Measured yesterday against content hash 79812177acbc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

framer-motion scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/framer-motion/SKILL.md · 163 lines

How it starts

The opening of the file, as written. The whole thing — 163 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Framer Motion Skill

You are a Framer Motion expert for React and Next.js applications.

Critical Rules

  1. Always add 'use client'motion components use browser APIs and cannot run in Server Components. Any file using motion.*, AnimatePresence, useScroll, useMotionValue, or useAnimate must declare 'use client' at the top.

  2. Import from motion/react — The package was renamed. The correct import is:

    import { motion, AnimatePresence } from 'motion/react'
    

    Never import from 'framer-motion' — that is the old package name.

  3. Prefer CSS for trivial animations — If the animation is simple opacity or transform with no interactivity, use CSS transitions. Reserve motion for interactive gestures, staggered sequences, layout animations, and exit animations.

  4. Use layoutId for shared layout transitions — When an element moves between positions or DOM locations (e.g., a selected card expanding, a tab indicator sliding), assign matching layoutId props. Framer Motion handles the FLIP animation automatically.

  5. Wrap exit animations with AnimatePresence — The exit prop on a motion component only fires when the component is removed from the tree and it is a direct child of AnimatePresence. Without the wrapper, exit animations are silently skipped.

  6. Respect prefers-reduced-motion — Check useReducedMotion() 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" />

Read the full file on GitHub · 163 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 163 lines · 101 tokens per session scan A 79812177acbc

Subscribe to this mod's changes

framer-motion is a skill published in the GitHub repository iwritec0de/app-dev (3 stars, last pushed 4mo ago), licensed MIT. It adds 101 tokens to every session and 1,486 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

mastering-engineer

Guides audio mastering for streaming platforms including loudness optimization and tonal balance. Use when the user has approved tracks and wants to master audio files.

bitwize-music-studio/claude-ai-music-skills · 34 tokens

suno-engineer

Constructs technical Suno V5/V5.5 style prompts, selects genres, and optimizes generation settings. Use when creating or refining Suno prompts for track generation.

bitwize-music-studio/claude-ai-music-skills · 40 tokens

mix-engineer

Polishes raw Suno audio by processing per-stem WAVs (vocals, backingvocals, drums, bass, guitar, keyboard, strings, brass, woodwinds, percussion, synth, other) with targeted cleanup, EQ, and compression, then remixing into a polished stereo WAV ready for mastering. Use after audio import and before mastering.

bitwize-music-studio/claude-ai-music-skills · 76 tokens

configure

Sets up or edits the plugin configuration file interactively. Use on first-time setup, when config is missing, or when the user wants to change settings.

bitwize-music-studio/claude-ai-music-skills · 33 tokens

lyric-reviewer

Reviews lyrics against a quality checklist before Suno generation. Use before generating tracks to catch rhyme, prosody, pronunciation, and structural issues.

bitwize-music-studio/claude-ai-music-skills · 33 tokens

pronunciation-specialist

Scans lyrics for pronunciation risks and prevents Suno mispronunciations. Use when writing lyrics with proper nouns, technical terms, homographs, or non-English words.

bitwize-music-studio/claude-ai-music-skills · 39 tokens