Token导航 LogoToken导航

Agent Skill · 研究检索

motion(动效设计)

motion 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

motion 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 58,594。

总安装 412周安装 17GitHub Stars 88下载 135核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:motion(动效设计)
来源仓库:https://github.com/blockmatic/basilic
仓库路径:skills/motion
安装命令:
npx skills add https://github.com/blockmatic/basilic --skill motion
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/blockmatic/basilic --skill motion

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

Framer Motion 官方推荐技能,支持声明式动画与物理引擎驱动效果。涵盖拖拽、视口滚动动画、FLIP 布局过渡与自然弹簧运动曲线配置。提供 300+ 官方示例参考,适用于复杂交互动效与跨平台一致性保障。生产环境部署前应压缩 bundle 体积,避免过度动画拖累首屏渲染性能。

motion 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/motion

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/blockmatic/basilic --skill motion;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

motion 怎么安装?

在终端执行 npx skills add https://github.com/blockmatic/basilic --skill motion。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

motion 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

motion 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

motion 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

motion 用的人多吗?

公开数据是累计安装 412 次,近一周安装 17 次,下载 135 次,GitHub 88 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

motion 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
motion

动效设计 · 本页

41288操作浏览器未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

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

"use client"

import { motion } from "motion/react"

export function AnimatedCard() {
  return <motion.div>...</motion.div>
}

Known Issues (Next.js 15+ + React 19):

  • React 19 fully supported as of December 2025 (see Issue #11 for one StrictMode edge case)
  • Most compatibility issues resolved in Motion 12.27.5
  • AnimatePresence may fail with soft navigation
  • Reorder component incompatible with Next.js routing and page-level scrolling (see Issue #10)

Next.js Pages Router

Works without modifications:

import { motion } from "motion/react"

export default function Page() {
  return <motion.div>No "use client" needed</motion.div>
}

Tailwind CSS Integration

Best Practice: Let each library do what it does best.

  • Tailwind: Static and responsive styling via className
  • Motion: Animations via motion props
<motion.button
  className="bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700"
  whileHover={{ scale: 1.1 }}
  whileTap={{ scale: 0.95 }}
>
  Tailwind styles + Motion animations
</motion.button>

⚠️ Remove Tailwind Transitions: Causes stuttering/conflicts.

// ❌ Wrong - Tailwind transition conflicts with Motion
<motion.div className="transition-all duration-300" animate={{ x: 100 }} />

// ✅ Correct - Remove Tailwind transition
<motion.div animate={{ x: 100 }} />

Why: Motion uses inline styles or native browser animations, both override Tailwind's CSS transitions.

Cloudflare Workers (✅ Now Supported)

Status: ✅ Fixed as of December 2024 (GitHub issue #2918 closed as completed)

Installation:

# Motion now works directly with Cloudflare Workers
pnpm add motion

Import:

import { motion } from "motion/react"

Historical Note: Prior to December 2024, there was a Wrangler ESM resolution issue requiring use of framer-motion as a workaround. This has been resolved, and both packages now work correctly with Cloudflare Workers.


Performance Optimization

1. Reduce Bundle Size with LazyMotion

Problem: Full motion component is ~34 KB minified+gzipped.

Solution: Use LazyMotion + m component for 4.6 KB:

import { LazyMotion, domAnimation, m } from "motion/react"

function App() {
  return (
    <LazyMotion features={domAnimation}>
      {/* Use 'm' instead of 'motion' */}
      <m.div
        initial={{ opacity: 0 }}
        animate={{ opacity: 1 }}
      >
        Only 4.6 KB!
      </m.div>
    </LazyMotion>
  )
}

How it works: Loads animation features on-demand instead of bundling everything.

Alternative (Smallest): useAnimate mini (2.3 KB):

import { useAnimate } from "motion/react"

function Component() {
  const [scope, animate] = useAnimate()

  return <div ref={scope}>Smallest possible React animation</div>
}

2. Hardware Acceleration

Add willChange for transforms:

<motion.div
  style={{ willChange: "transform" }}
  animate={{ x: 100, rotate: 45 }}
/>

Also add for: opacity, backgroundColor, clipPath, filter

How it works: Tells browser to optimize for animation, uses GPU compositing.

3. Large Lists → Use Virtualization

Problem: Animating 50-100+ items causes severe slowdown.

Solutions:

pnpm add react-window
# or
pnpm add react-virtuoso
# or
pnpm add @tanstack/react-virtual

Pattern:

import { FixedSizeList } from 'react-window'
import { motion } from 'motion/react'

<FixedSizeList
  height={600}
  itemCount={1000}
  itemSize={50}
>
  {({ index, style }) => (
    <motion.div style={style} layout>
      Item {index}
    </motion.div>
  )}
</FixedSizeList>

Why: Only renders visible items, reduces DOM updates and memory usage.

4. Use layout Prop for FLIP Animations

Automatically animates layout changes without JavaScript calculation:

<motion.div layout>
  {isExpanded ? <LargeContent /> : <SmallContent />}
</motion.div>

Performance: Hardware-accelerated via transforms, no reflow/repaint.


Accessibility

Respect prefers-reduced-motion

import { MotionConfig } from "motion/react"

<MotionConfig reducedMotion="user">
  <App />
</MotionConfig>

Options:

  • "user": Respects OS setting (recommended)
  • "always": Force instant transitions
  • "never": Ignore user preference

Note: ✅ Fixed in Jan 2023 (GitHub #1567) - MotionConfig now works correctly with AnimatePresence.


Common Patterns

5 Production-Ready Patterns:

  1. Modal Dialog - AnimatePresence with backdrop + dialog exit animations
  2. Accordion - Animate height with height: "auto"
  3. Drag Carousel - drag="x" with dragConstraints
  4. Scroll Reveal - whileInView with viewport margin
  5. Parallax Hero - useScroll + useTransform for layered effects

See references/common-patterns.md for full code (15+ patterns).


Known Issues & Solutions

Issue 1: AnimatePresence Exit Not Working

Error: Exit animations don't play, components disappear instantly Source: GitHub Issue #3078

Why It Happens: AnimatePresence wrapped in conditional or missing key props. Defining exit props on staggered children inside modals can also prevent modal from unmounting (backdrop remains visible).

Solution:

// ❌ Wrong - AnimatePresence wrapped in conditional
{isVisible && (
  <AnimatePresence>
    <motion.div>Content</motion.div>
  </AnimatePresence>
)}

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

// ❌ Wrong - Staggered children with exit prevent modal removal
<AnimatePresence>
  {isOpen && (
    <Modal>
      <motion.ul>
        {items.map(item => (
          <motion.li
            key={item.id}
            exit={{ opacity: 1, scale: 1 }}  // ← Prevents modal unmount
          >
            {item.content}
          </motion.li>
        ))}
      </motion.ul>
    </Modal>
  )}
</AnimatePresence>

// ✅ Fix for modal - Remove exit from children or set duration: 0
<motion.li
  key={item.id}
  exit={{ opacity: 0, scale: 0.5, transition: { duration: 0 } }}
>
  {item.content}
</motion.li>

Issue 2: Large List Performance

Symptom: 50-100+ animated items cause severe slowdown, browser freezes.

Solution: Use virtualization:

pnpm add react-window

See references/performance-optimization.md for full guide.

Issue 3: Tailwind Transitions Conflict

Symptom: Animations stutter or don't work.

Solution: Remove transition-* classes:

// ❌ Wrong
<motion.div className="transition-all" animate={{ x: 100 }} />

// ✅ Correct
<motion.div animate={{ x: 100 }} />

Issue 4: Next.js "use client" Missing

Symptom: Build fails with "motion is not defined" or SSR errors.

Solution: Add "use client" directive:

"use client"

import { motion } from "motion/react"

See references/nextjs-integration.md for App Router patterns.

Issue 5: Scrollable Container Layout Animations

Symptom: Incomplete transitions when removing items from scrolled containers.

Solution: Add layoutScroll prop:

<motion.div layoutScroll className="overflow-auto">
  {items.map(item => (
    <motion.div key={item.id} layout>
      {item.content}
    </motion.div>
  ))}
</motion.div>

Issue 6: Cloudflare Workers Build Errors (✅ RESOLVED)

Status: ✅ Fixed in December 2024 (GitHub issue #2918 closed as completed)

Previous Symptom: Wrangler build failed with React import errors when using motion package.

Current State: Motion now works correctly with Cloudflare Workers. No workaround needed.

If you encounter build issues: Ensure you're using Motion v12.23.24 or later and Wrangler v3+.

GitHub issue: #2918 (closed as completed Dec 13, 2024)

Issue 7: Fixed Position Layout Animations

Symptom: Layout animations in fixed elements have incorrect positioning.

Solution: Add layoutRoot prop:

<motion.div layoutRoot className="fixed top-0 left-0">
  <motion.div layout>Content</motion.div>
</motion.div>

Issue 8: layoutId + AnimatePresence Unmounting

Symptom: Elements with layoutId inside AnimatePresence fail to unmount.

Solution: Wrap in LayoutGroup or avoid mixing exit + layout animations:

import { LayoutGroup } from "motion/react"

<LayoutGroup>
  <AnimatePresence>
    {items.map(item => (
      <motion.div key={item.id} layoutId={item.id}>
        {item.content}
      </motion.div>
    ))}
  </AnimatePresence>
</LayoutGroup>

Issue 9: Reduced Motion with AnimatePresence (✅ RESOLVED)

Status: ✅ Fixed in January 2023 (GitHub issue #1567 closed via PR #1891)

Previous Symptom: MotionConfig reducedMotion setting didn't affect AnimatePresence animations.

Current State: MotionConfig now correctly applies reducedMotion to AnimatePresence components. The setting works as documented.

Optional Manual Control: If you need custom behavior beyond the built-in support:

const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches

<motion.div
  initial={{ opacity: prefersReducedMotion ? 1 : 0 }}
  animate={{ opacity: 1 }}
  transition={{ duration: prefersReducedMotion ? 0 : 0.3 }}
/>

GitHub issue: #1567 (closed as completed Jan 13, 2023)

Issue 10: Reorder Component Limitations

Error: Reorder auto-scroll fails, doesn't work with Next.js routing Source: GitHub Issue #3469, #2183, #2101

Why It Happens:

  • Page-level scrolling: Reorder auto-scroll only works when Reorder.Group is inside element with overflow: auto/scroll, NOT when document itself is scrollable
  • Next.js routing: Incompatible with Next.js routing system, causes random stuck states

Prevention:

// ❌ Wrong - Page-level scrolling (auto-scroll fails)
<body style={{ height: "200vh" }}>
  <Reorder.Group values={items} onReorder={setItems}>
    {/* Auto-scroll doesn't trigger at viewport edges */}
  </Reorder.Group>
</body>

// ✅ Correct - Container with overflow
<div style={{ height: "300px", overflow: "auto" }}>
  <Reorder.Group values={items} onReorder={setItems}>
    {items.map(item => (
      <Reorder.Item key={item.id} value={item}>
        {item.content}
      </Reorder.Item>
    ))}
  </Reorder.Group>
</div>

// ✅ Alternative - Use DnD Kit for complex cases
// Motion docs officially recommend DnD Kit for:
// - Multi-row reordering
// - Dragging between columns
// - Page-level scrollable containers
// - Complex drag-and-drop interactions

// Install: pnpm add @dnd-kit/core @dnd-kit/sortable @dnd-kit/utilities

See references/nextjs-integration.md for full Next.js troubleshooting guide.

Issue 11: React 19 StrictMode Drag Bug

Error: Drag gestures break when dragging from top to bottom in file trees Source: GitHub Issue #3169

Why It Happens: Only occurs with React 19 + StrictMode enabled + Ant Design components. Dragged element position breaks and appears offset. Does NOT occur in React 18 or React 19 without StrictMode. Only affects top-to-bottom drag (bottom-to-top works fine).

Prevention: Temporarily disable StrictMode for React 19 projects using drag gestures, or use React 18 if StrictMode is critical. Awaiting official fix from Motion team.

Issue 12: Layout Animations in Scaled Containers

Error: Layout animations start from incorrect positions in scaled parent containers Source: GitHub Issue #3356

Why It Happens: Layout animation system uses scaled coordinates as if they were unscaled. Motion's layout animations work in pixels, while parent scale affects visual coordinates. The mismatch causes position calculation errors.

Prevention (Community Workaround):

// Use transformTemplate to correct for parent scale
const scale = 2; // Parent's transform scale value

<div style={{ transform: `scale(${scale})` }}>
  <motion.div
    layout
    transformTemplate={(latest, generated) => {
      const match = /translate3d\((.+)px,\s?(.+)px,\s?(.+)px\)/.exec(generated);
      if (match) {
        const [, x, y, z] = match;
        return `translate3d(${Number(x) / scale}px, ${Number(y) / scale}px, ${Number(z) / scale}px)`;
      }
      return generated;
    }}
  >
    Content
  </motion.div>
</div>

Limitations: Only works for layout animations only, doesn't fix other transforms, requires knowing parent scale value.

Issue 13: AnimatePresence Exit Gets Stuck on Unmount

Error: Exit state stuck when child unmounts during exit animation Source: GitHub Issue #3243

Why It Happens: When child component inside AnimatePresence unmounts immediately after exit animation triggers, exit state gets stuck. Component incorrectly remains in "exit" state.

Prevention: Don't unmount motion components while AnimatePresence is handling their exit. Ensure motion.div stays mounted until exit completes. Use conditional rendering only on parent AnimatePresence children.

Issue 14: Percentage Values Break Layout Animations in Flex Containers

Error: Layout animations teleport instantly instead of animating smoothly Source: GitHub Issue #3401

Why It Happens: Using percentage-based x values in initial prop breaks layout animations when container uses display flex with justify-content center. Motion's layout animations work in pixels, while CSS percentage transforms are resolved relative to element/parent. The coordinate system mismatch causes position recalculation mid-frame.

Prevention: Convert percentage to pixels before animation. Calculate container width and use pixel values instead of percentage strings.

Issue 15: Sub-Pixel Precision Loss in popLayout Mode

Error: 1px layout shift just before exit transition starts Source: GitHub Issue #3260

Why It Happens: When using AnimatePresence with mode popLayout, exiting element dimensions are captured and reapplied as inline styles. Sub-pixel values from getBoundingClientRect are rounded to nearest integer, causing visible layout shift. Can cause text wrapping changes.

Prevention: Use whole pixel values only for dimensions, or avoid popLayout for sub-pixel-sensitive layouts. No perfect workaround exists.


Templates

This skill includes 5 production-ready templates in the templates/ directory:

  1. motion-vite-basic.tsx - Basic Vite + React + TypeScript setup with common animations
  2. motion-nextjs-client.tsx - Next.js App Router pattern with client component wrapper
  3. scroll-parallax.tsx - Scroll animations, parallax, and viewport triggers
  4. ui-components.tsx - Modal, accordion, carousel, tabs with shared underline
  5. layout-transitions.tsx - FLIP layout animations and shared element transitions

Copy templates into your project and customize as needed.


References

This skill includes 4 comprehensive reference guides:

  • motion-vs-auto-animate.md - Decision guide: when to use Motion vs AutoAnimate
  • performance-optimization.md - Bundle size, LazyMotion, virtualization, hardware acceleration
  • nextjs-integration.md - App Router vs Pages Router, "use client", known issues
  • common-patterns.md - Top 15 patterns with full code examples

See references/ directory for detailed guides.


Scripts

This skill includes 2 automation scripts:

  • init-motion.sh - One-command setup with framework detection (Vite, Next.js, Cloudflare Workers)
  • optimize-bundle.sh - Convert existing Motion code to LazyMotion for smaller bundle

See scripts/ directory for automation tools.


Official Documentation


Related Skills

  • auto-animate - For simple list add/remove/sort animations (3.28 KB vs 34 KB)
  • tailwind-v4-shadcn - Styling integration
  • nextjs - Next.js App Router patterns
  • cloudflare-worker-base - Deployment (Motion now fully compatible)

Comparison: Motion vs AutoAnimate

AspectAutoAnimateMotion
Bundle Size3.28 KB2.3 KB (mini) - 34 KB (full)
Use CaseSimple list animationsComplex gestures, scroll, layout
APIZero-config, 1 lineDeclarative props, verbose
SetupSingle refMotion components + props
Gestures❌ Not supported✅ Drag, hover, tap, pan
Scroll Animations❌ Not supported✅ Parallax, scroll-linked
Layout Animations❌ Not supported✅ FLIP, shared elements
SVG❌ Not supported✅ Path morphing, line drawing
Cloudflare Workers✅ Full support✅ Full support (fixed Dec 2024)
Accessibility✅ Auto prefers-reduced-motion✅ Manual MotionConfig

Rule of Thumb: Use AutoAnimate for 90% of cases (list animations), Motion for 10% (complex interactions).

See references/motion-vs-auto-animate.md for detailed comparison.


Token Efficiency Metrics

ApproachTokens UsedErrors EncounteredTime to Complete
Manual Setup~30,0003-5 (AnimatePresence, Next.js, performance)~2-3 hours
With This Skill~5,0000 ✅~20-30 min
Savings~83%100%~85%

Errors Prevented: 35 documented errors = 100% prevention rate


Package Versions (Verified 2026-01-21)

PackageVersionStatus
motion12.27.5✅ Latest stable
framer-motion12.27.5✅ Same version as motion
react19.2.3✅ Latest stable
next16.1.1✅ Latest stable
vite7.3.1✅ Latest stable

Contributing

Found an issue or have a suggestion?


Production Tested: ✅ React 19.2 + Next.js 16.1 + Vite 7.3 + Tailwind v4 Token Savings: ~83% Error Prevention: 100% (35 documented errors prevented) Bundle Size: 2.3 KB (mini) - 34 KB (full), optimizable to 4.6 KB with LazyMotion Accessibility: MotionConfig reducedMotion support Last verified: 2026-01-21 | Skill version: 3.1.0 | Changes: Added 5 new React 19/layout animation issues, updated to Motion 12.27.5

平台分布

Codex

36.45%
按下载量换算49

Claude

32.45%
按下载量换算44

Cursor

17.29%
按下载量换算23

Gemini CLI

8.58%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills