motion

jezweb/claude-skills · updated May 7, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/jezweb/claude-skills --skill motion
0 commentsdiscussion
summary

React animation library with gestures, scroll effects, layout transitions, and spring physics.

  • Supports drag-and-drop, hover/tap feedback, scroll-triggered reveals, parallax, and FLIP layout animations with hardware acceleration
  • Three bundle options: 2.3 KB mini (useAnimate), 4.6 KB optimized (LazyMotion), or 34 KB full component library
  • Requires \"use client\" directive in Next.js App Router; works without modification in Pages Router and Vite
  • 35+ documented issues with solutions
skill.md

Motion Animation Library

Overview

Motion (package: motion, formerly framer-motion) is the industry-standard React animation library used in production by thousands of applications. With 30,200+ GitHub stars and 300+ official examples, it provides a declarative API for creating sophisticated animations with minimal code.

Key Capabilities:

  • Gestures: drag, hover, tap, pan, focus with cross-device support
  • Scroll Animations: viewport-triggered, scroll-linked, parallax effects
  • Layout Animations: FLIP technique for smooth layout changes, shared element transitions
  • Spring Physics: Natural, customizable motion with physics-based easing
  • SVG: Path morphing, line drawing, attribute animation
  • Exit Animations: AnimatePresence for unmounting transitions
  • Performance: Hardware-accelerated, ScrollTimeline API, bundle optimization (2.3 KB - 34 KB)

Production Tested: React 19.2, Next.js 16.1, Vite 7.3, Tailwind v4


When to Use This Skill

✅ Use Motion When:

Complex Interactions:

  • Drag-and-drop interfaces (sortable lists, kanban boards, sliders)
  • Hover states with scale/rotation/color changes
  • Tap feedback with bounce/squeeze effects
  • Pan gestures for mobile-friendly controls

Scroll-Based Animations:

  • Hero sections with parallax layers
  • Scroll-triggered reveals (fade in as elements enter viewport)
  • Progress bars linked to scroll position
  • Sticky headers with scroll-dependent transforms

Layout Transitions:

  • Shared element transitions between routes (card → detail page)
  • Expand/collapse with automatic height animation
  • Grid/list view switching with smooth repositioning
  • Tab navigation with animated underline

Advanced Features:

  • SVG line drawing animations
  • Path morphing between shapes
  • Spring physics for natural bounce
  • Orchestrated sequences (staggered reveals)
  • Modal dialogs with backdrop blur

Bundle Optimization:

  • Need 2.3 KB animation library (useAnimate mini)
  • Want to reduce Motion from 34 KB to 4.6 KB (LazyMotion)

❌ Don't Use Motion When:

Simple List Animations → Use auto-animate skill instead:

  • Todo list add/remove (auto-animate: 3.28 KB vs motion: 34 KB)
  • Search results filtering
  • Shopping cart items
  • Notification toasts
  • Basic accordions without gestures

Static Content:

  • No user interaction or animations needed
  • Server-rendered content without client interactivity

Cloudflare Workers Deployment → ✅ Fixed (Dec 2024):

  • Previous build compatibility issues resolved (GitHub issue #2918 closed as completed)
  • Motion now works directly with Wrangler - no workaround needed
  • Both motion and framer-motion v12.23.24 work correctly

3D Animations → Use dedicated 3D library:

  • Three.js for WebGL
  • React Three Fiber for React + Three.js

Installation

Latest Stable Version

# Using pnpm (recommended)
pnpm add motion

# Using npm
npm install motion

# Using yarn
yarn add motion

Current Version: 12.27.5 (verified 2026-01-21)

Note for Cloudflare Workers:

# Both packages work with Cloudflare Workers (issue #2918 fixed Dec 2024)
pnpm add motion
# OR
pnpm add framer-motion  # Same version, same API

Package Information

  • Bundle Size:
    • Full motion component: ~34 KB minified+gzipped
    • LazyMotion + m component: ~4.6 KB
    • useAnimate mini: 2.3 KB (smallest React animation library)
    • useAnimate hybrid: 17 KB
  • Dependencies: React 18+ or React 19+
  • TypeScript: Native support included (no @types package needed)

Core Concepts

1. AnimatePresence (Exit Animations)

Enables animations when components unmount:

import { AnimatePresence } from "motion/react"

<AnimatePresence>
  {isVisible && (
    <motion.div
      key="modal"
      initial={{ opacity: 0 }}
      animate={{ opacity: 1 }}
      exit={{ opacity: 0 }}
    >
      Modal content
    </motion.div>
  )}
</AnimatePresence>

Critical Rules:

  • AnimatePresence must stay mounted (don't wrap in conditional)
  • All children must have unique key props
  • AnimatePresence wraps the conditional, not the other way around

Common Mistake (exit animation won't play):

// ❌ Wrong - AnimatePresence unmounts with condition
{isVisible && (
  <AnimatePresence>
    <motion.div>Content</motion.div>
  </AnimatePresence>
)}

// ✅ Correct - AnimatePresence stays mounted
<AnimatePresence>
  {isVisible && <motion.div key="unique">Content</motion.div>}
</AnimatePresence>

2. Layout Animations

Special Props:

  • layout: Enable FLIP layout animations
  • layoutId: Connect separate elements for shared transitions
  • layoutScroll: Fix animations in scrollable containers (see Issue #5)
  • layoutRoot: Fix animations in fixed-position elements (see Issue #7)
<motion.div layout>
  {isExpanded ? <FullContent /> : <Summary />}
</motion.div>

3. Scroll Animations

Viewport-Triggered (whileInView)

<motion.div
  initial={{ opacity: 0, y: 50 }}
  whileInView={{ opacity: 1, y: 0 }}
  viewport={{ once: true, margin: "-100px" }}
>
  Fades in when 100px from entering viewport
</motion.div>

Scroll-Linked (useScroll)

import { useScroll, useTransform } from "motion/react"

const { scrollYProgress } = useScroll()
const y = useTransform(scrollYProgress, [0, 1], [0, -300])

<motion.div style={{ y }}>
  Moves up 300px as user scrolls page
</motion.div>

Performance: Uses native ScrollTimeline API when available for hardware acceleration.


Integration Guides

Vite + React + TypeScript

pnpm add motion

Import: import { motion } from "motion/react"

No Vite configuration needed - works out of the box.

Next.js App Router (Recommended Pattern)

Key Requirement: Motion only works in Client Components (not Server Components).

Step 1: Create Client Component Wrapper

src/components/motion-client.tsx:

"use client"

// Optimized import for Next.js (reduces client JS)
import * as motion from "motion/react-client"

export { motion }

Step 2: Use in Server Components

src/app/page.tsx:

import { motion } from "@/components/motion-client"

export default function Page() {
  return (
    <motion.div
      initial={{ opacity: 0 }}
      animate={{ opacity: 1 }}
    >
      This works in Server Component (wrapper is client)
    </motion.div>
  )
}

Alternative: Direct Client Component

how to use motion

How to use motion on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add motion
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/jezweb/claude-skills --skill motion

The skills CLI fetches motion from GitHub repository jezweb/claude-skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/motion

Reload or restart Cursor to activate motion. Access the skill through slash commands (e.g., /motion) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.665 reviews
  • Mei Liu· Dec 28, 2024

    Useful defaults in motion — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Dhruvi Jain· Dec 24, 2024

    Keeps context tight: motion is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Sofia Shah· Dec 24, 2024

    Solid pick for teams standardizing on skills: motion is focused, and the summary matches what you get after install.

  • Mei Farah· Dec 20, 2024

    Keeps context tight: motion is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Sofia Patel· Dec 16, 2024

    I recommend motion for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Ren Khan· Dec 12, 2024

    I recommend motion for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Ira Kapoor· Dec 8, 2024

    Registry listing for motion matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Pratham Ware· Dec 4, 2024

    Useful defaults in motion — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Mei Diallo· Dec 4, 2024

    motion reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Isabella Abebe· Nov 27, 2024

    Keeps context tight: motion is the kind of skill you can hand to a new teammate without a long onboarding doc.

showing 1-10 of 65

1 / 7