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.

referencesCOMPONENTS.md

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

Component patterns and review

Use these as decisions to implement with installed types, not a complete component library. Keep application semantics and accessibility in the app's existing UI system.

Local presence

A minimal visual presence pattern is:

'use client';
import type { ReactNode } from 'react';
import { AnimatePresence, motion, useReducedMotion } from 'motion/react';

export function PresencePanel({ open, children }: { open: boolean; children: ReactNode }) {
  const reduce = useReducedMotion();
  return (
    <AnimatePresence initial={false}>
      {open && (
        <motion.div key="panel"
          initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }}
          transition={{ duration: reduce ? 0 : 0.16 }}>
          {children}
        </motion.div>
      )}
    </AnimatePresence>
  );
}

This is visual-only. Interactive exiting content needs focus/inertness handling through a presence-aware child or the UI library. A dialog also needs semantics, labelling, dismissal, focus restoration, and background control. Do not present the example as a complete modal, accordion, or production accessibility solution.

AnimatePresence needs stable unique direct-child keys and must outlive their removal. wait supports one child at a time. Nested boundaries need deliberate propagation. popLayout needs the documented ref/positioning contract for custom children. Do not add an exit prop to a conditional element with no surviving presence boundary and expect it to run.

Layout and shared identity

Use layout for actual React-driven geometry changes; use layout="position" where size interpolation would distort content. LayoutGroup scopes/co-ordinates related layout work, and unique group IDs prevent separate tab rows sharing one underline. A visual tab row still needs actual tab/list/panel semantics and keyboard behaviour. For accordions, preserve expanded/controls state, content labelling, and focus when collapsing. Dynamic content needs measured layout rather than guessed heights.

For Reorder, stable values must identify items uniquely. Duplicate visible labels are not adequate IDs. Provide non-drag reorder controls and persist order through the application's actual state/transaction logic.

Scroll and sequences

Use whileInView for a modest reveal and the correct root for nested scrollers. For progress/parallax, use motion values without React state updates per scroll frame. Reduced motion should remove nonessential travel; essential progress must remain readable. Confirm offscreen/hidden content is not trapping focus.

Use scoped useAnimate when imperative sequencing is justified. Cancel superseded work and cleanup timers/listeners. Bound stagger delay for long/virtualised lists; a hundred items should not wait through a decorative queue. Avoid selectors that capture unrelated descendant controls.

Bundle and wrappers

For LazyMotion use the matching lightweight m entry point. domAnimation covers standard animation/presence/gestures; layout/drag needs the documented richer feature set. Do not accidentally bundle full motion components inside a supposedly minimal boundary. Measure the production bundle rather than quote a package-size claim as the app's saving.

Use motion.create outside render and forward the correct DOM ref. Derive wrapper props from Motion's actual element prop types when accepting arbitrary handlers; React DOM drag/animation event types can collide with Motion gesture callbacks. Preserve disabled state, button type, focus styling, refs, and layout instead of adding arbitrary wrapper divs.

Motion policy

Use the design system's durations, distances, and easing; fixed ranges are starting heuristics, not universal correctness. Test interrupted animations, hover on touch, keyboard activation, reduced-motion changes, and repeated interaction. Prefer unchanged usable content to a broken effect. Do not put business logic exclusively in onAnimationComplete.

Sources reviewed 2026-09-13:

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