Motion

From Asymmetric-al/core · View interactive version

Motion is an AI agent skill from the GitHub repository Asymmetric-al/core. Implement smooth, accessible animations with motion/react (Framer Motion) in React. Use when adding animations, gestures, or layout transitions with motion, AnimatePresence, useScroll, and related APIs. Requires a 'use client' boundary; not for strictly server-rendered components or when no animatio

How to use this skill

Skill file

Motion (`motion/react`) in Core

API usage for motion/react. Core's motion contract (tokens, presets, route view transitions, reduced-motion baseline) lives in docs/ai/skills/anim/SKILL.md; read it first.

Rules

Workflow

  1. Identify the UX purpose (feedback, transition, focus).
  2. Add the smallest 'use client' boundary.
  3. Implement enter/exit or layout transitions correctly.
  4. Respect reduced motion preferences.
  5. Check performance and bundle size.

Checklists

Implementation checklist

Review checklist

Minimal examples

Enter/exit

"use client";

import { AnimatePresence, motion } from "@asym/lib/motion";
import { transitionStandard } from "@asym/lib/motion-presets";

export function Toast({
  open,
  children,
}: {
  open: boolean;
  children: React.ReactNode;
}) {
  return (
    <AnimatePresence>
      {open ? (
        <motion.div
          initial={{ opacity: 0, y: 8 }}
          animate={{ opacity: 1, y: 0 }}
          exit={{ opacity: 0, y: 8 }}
          transition={transitionStandard}
        >
          {children}
        </motion.div>
      ) : null}
    </AnimatePresence>
  );
}

Reduced motion

"use client";

import { motion, useReducedMotion } from "@asym/lib/motion";
import { transitionStandard } from "@asym/lib/motion-presets";

export function FadeIn({ children }: { children: React.ReactNode }) {
  const reduce = useReducedMotion();
  return (
    <motion.div
      initial={reduce ? false : { opacity: 0, y: 6 }}
      animate={reduce ? { opacity: 1 } : { opacity: 1, y: 0 }}
      transition={transitionStandard}
    >
      {children}
    </motion.div>
  );
}

Common mistakes / pitfalls

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.