Index of every page on this site: llms.txt
All skills
tristanmanchester avatar

/nextjs-framer-motion-animations

@3323bc9
Run it yourself

Implement and debug Motion for React in Next.js: local interaction, presence, layout, shared elements, scroll, reduced motion, and router integration. Use for explicit Motion/Framer Motion work or interactions that need it; prefer CSS for simple effects and framework-native view transitions for supported route cases.

Use this Skill: https://skilld.dev/gh/tristanmanchester/agent-skills/nextjs-framer-motion-animations

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesROUTING.md

≈909 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Router integration

App Router

Layouts persist; templates remount at their own segment boundary, including changed dynamic parameters. A deeper navigation need not remount a higher template, and search-parameter changes do not automatically remount it. Use a template only when its state-reset/effect-restart behaviour is desired, not as a free animation wrapper.

For enter-only motion, render a small animated leaf from the relevant template. For local toggles, keep AnimatePresence around a child whose visibility and key the application actually controls. Neither proves complete route exit choreography.

A generic AnimatePresence around <motion.main key={pathname}>{children}</motion.main> in a persistent layout lacks a demonstrated contract for retaining an unchanged outgoing router subtree. Verify that contract before making exit guarantees. Do not solve it through private router-context snapshots, frozen stale data, nested main landmarks, or indiscriminate navigation interception.

Source: https://nextjs.org/docs/app/api-reference/file-conventions/template Source: https://motion.dev/docs/react-animate-presence

Current framework view transitions

The current Next.js guide (updated 2026-08-25) documents React ViewTransition in the App Router without configuration, using the React build supplied by Next. Check the app's actual version; do not copy an old experimental flag or separately install React canary merely because an old article required it.

Choose unique shared-element names on the participating pages. A shared-element pair needs appropriate old/new content in the same commit: a suspended destination can instead follow its loading/enter path. Default animations and explicit share settings must match; test unrelated updates to avoid accidental crossfades. Navigation direction tags are intentional application metadata, not automatic proof of browser back/forward intent. Preserve interaction and reduced-motion fallbacks, and check browser support.

Motion AnimateView is separately labelled alpha in the reviewed docs. Its existence does not require adopting it when Next's documented view-transition surface or a simple local animation suffices. Keep experimental adoption explicit.

Sources:

Pages Router

Pages Router has a different ownership model. A persistent presence boundary in _app can observe keyed page replacement; check what the page actually renders and whether the exiting component remains stable. Keys should reflect the intended route identity, not an array index. Avoid hydration differences from asPath before the router is ready, and decide whether query-only changes should replay motion. Do not move a one-off animation into _app merely for convenience.

Server and client rendering

Use motion/react-client for a supported declarative motion element from a server file, and a Client Component for hooks/presence/scroll/interactive logic. Do not pass ordinary server closures as event handlers. Keep server children, their data, and route/loading/error boundaries intact. Do not add a root client boundary just to satisfy one import.

Browser acceptance matrix

Verify: direct load; hydrated navigation; dynamic segment change; query change; back/forward; rapid double navigation; cancelled or superseded navigation; suspended and failed data; focus/scroll restoration; reduced motion; unsupported browser; and no unexpected duplicated landmarks/content. Record expected versus observed behaviour rather than treating a persistent wrapper as proof.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning1mo5 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill is a developer tool designed to help AI agents implement and debug animations in Next.js applications using the Motion (Framer Motion) library. It includes local Node.js scripts for codebase auditing and planning, along with a library of accessible React component templates. No security risks were identified.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

  • Runlayer7mo

    8/77 files flagged

  • ZeroLeaks6mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 3323bc9. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Steadyupdated last month
metadata
{
  "version": "5.0.0",
  "reviewed": "2026-09-13"
}
Other metadata
compatibility
Use the current motion package and the app's supported React/Next.js/runtime versions. Inspect locked versions and router type. No legacy import-rewriting wrapper or automatic project scaffolding is provided.

README badge

README badge for tristanmanchester/agent-skills/nextjs-framer-motion-animations