Skip to content
Development
Skill

/web-animation-framer-motion

Motion (formerly Framer Motion) patterns - motion components, variants, AnimatePresence, gestures, layout animations, scroll-linked motion, reduced-motion handling

From plugin
skills
26200 skills

Claude Code

$ npx -y skills add agents-inc/skills --skill web-animation-framer-motion --agent claude-code

SKILL.md

web-animation-framer-motion.SKILL.md
name: web-animation-framer-motion
description: Motion (formerly Framer Motion) patterns - motion components, variants, AnimatePresence, gestures, layout animations, scroll-linked motion, reduced-motion handling

Motion Animation Patterns

> **Quick Guide:** `motion.*` components take `initial`, `animate`, `exit` and `transition` props; > variants lift those states into named sets a parent can orchestrate; `AnimatePresence` is what > keeps a removed component mounted long enough to animate out; `layout` and `layoutId` run FLIP > animations over layout changes; `useScroll` and `useInView` drive motion from scroll position. > Animate `x`, `y`, `scale`, `rotate` and `opacity`, and set `MotionConfig reducedMotion="user"` at > the root.

> **Import:** `import { motion } from "motion/react"` — the package was renamed from `framer-motion` > at v11.

**Detailed Resources:**

  • [examples/core.md](examples/core.md) — motion components, variants, AnimatePresence, gestures, reduced motion
  • [examples/layout.md](examples/layout.md) — `layout`, `layoutId`, expandable cards, tab indicators
  • [examples/scroll.md](examples/scroll.md) — scroll progress, reveal on view, parallax
  • [examples/sequences.md](examples/sequences.md) — `useAnimation` chains, keyframe arrays, `stagger()` shaping
  • [examples/svg.md](examples/svg.md) — `pathLength` drawing effects
  • [reference.md](reference.md) — v11/v12 migration, transition presets, prop and hook tables

---

Which path applies

  • **The element enters or leaves the React tree** — the animation needs `AnimatePresence` around it

and a `key` on it; follow [examples/core.md](examples/core.md).

  • **The element stays mounted while its size or position changes** — `layout` measures before and

after and animates the difference; follow [examples/layout.md](examples/layout.md).

  • **The same element appears in two places at different times** — a shared `layoutId` makes one

travel into the other; follow [examples/layout.md](examples/layout.md).

  • **Scroll position drives the value** — `useScroll` with `useTransform`, or `whileInView` for a

one-shot trigger; follow [examples/scroll.md](examples/scroll.md).

  • **Something outside React state triggers the animation** — a timer, a response, an error — then

`useAnimation` gives the imperative handle; follow [examples/sequences.md](examples/sequences.md).

---

<critical_requirements>

Before writing Motion code

**Wrap anything that animates on removal in `AnimatePresence`.** React unmounts the node the instant its condition goes false, so `exit` has nothing left to run against without the wrapper holding the node in the tree until the animation finishes.

**Give every direct child of `AnimatePresence` a stable, unique `key`.** The key is what `AnimatePresence` matches the departing element against; an index key re-points to a different item when the list changes and animates the wrong element out.

**Animate `x`, `y`, `scale`, `rotate` and `opacity`.** Motion writes these to `transform` and `opacity`, which the compositor owns; `height`, `width` and `marginTop` re-run layout on each frame instead.

**Set `MotionConfig reducedMotion="user"` at the app root.** Transform and layout animations then disable themselves for users who asked their OS for reduced motion, while opacity and colour keep working — so state changes stay legible rather than becoming instant.

</critical_requirements>

---

**Auto-detection:** motion/react, framer-motion, motion.div, AnimatePresence, MotionConfig, LayoutGroup, LazyMotion, layoutId, whileHover, whileTap, whileDrag, whileInView, useAnimation, useScroll, useTransform, useMotionValue, useSpring, useInView, usePageInView, useReducedMotion, useDragControls, staggerChildren, delayChildren, Variants

**Applies to:**

  • Enter, exit and presence animation tied to React's mount lifecycle
  • Orchestrating several elements from one parent with variants and stagger
  • Gesture-driven motion — hover, tap, drag, focus
  • Scroll-triggered and scroll-linked effects
  • Layout changes and shared-element transitions between containers
  • Imperative sequences fired by events React state does not model

**Handled elsewhere:**

  • Purely declarative state feedback — a hover colour, a focus ring — where nothing mounts, unmounts

or moves. The styling layer settles those without a component wrapper

  • Frame-level timeline authoring, where the deliverable is a scrubbable timeline rather than a set of

component states

  • Whole-document view swaps where the browser composites an outgoing and incoming page together

---

<philosophy>

Motion animates state rather than time. A component declares what it looks like in each state, and Motion works out the interpolation, the interruption and the velocity carried across it — which is why a spring interrupted mid-flight continues from where it was rather than restarting.

</philosophy>

---

<decision_framework>

When Motion earns its place

Motion is worth the component wrapper and the bundle when at least one is true:

  • The element is being **removed** from the tree and must animate before it goes
  • The **from** value is measured rather than authored — a layout change, a drag release, an

interrupted spring

  • Several elements must be **orchestrated** from one trigger, with stagger and reverse-on-exit
  • The animated value is **derived from a continuous input** such as scroll progress

None of those true means the motion is a state change with both ends known in advance, which needs no runtime.

Variants or direct props

Reach for variants once more than one element shares the animation, or once the parent needs to control child timing — `staggerChildren` and `delayChildren` only exist on the variant path, and children inherit the parent's variant name without being passed anything. A single element with two states is clearer with `initial`/`animate` written inline.

</decision_framework>

---

<patterns>

Core patterns

Pattern 1: Motion Components

Read more
@agents-inc
Ships withskills

The official skills marketplace for Agents Inc. 230+ skills covering everything from React and Prisma to Redis, ElevenLabs, and infrastructure tooling. Pick the skills that match your stack and install them via Claude Code. Need more control?

Stars on GitHub

Momentum

stars in total
26
Star history of agents-inc/skills on GitHub, a chart by star-history.com

Other skills on skills.

ai-infrastructure-litellm

ai-infrastructure-lite…

LiteLLM proxy server setup, TypeScript client patterns via OpenAI SDK, model routing, fallbacks, load balancing, spend tracking,…

@agents-inc@agents-incInstall Skill
ai-infrastructure-modal

ai-infrastructure-moda…

Serverless GPU compute platform for AI model deployment — web endpoints, GPU functions, model serving, and TypeScript client…

@agents-inc@agents-incInstall Skill
ai-infrastructure-ollama

ai-infrastructure-olla…

Local LLM inference with the Ollama JavaScript client -- chat, streaming, tool calling, vision, embeddings, structured output,…

@agents-inc@agents-incInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about web-animation-framer-motion.

Which coding agents can use web-animation-framer-motion?
web-animation-framer-motion installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.