react-motion
使用 Motion for React(原 Framer Motion)在 React/Next.js 中构建 UI 动画——微交互、使用 AnimatePresence 的进入/退出、布局与共享元素动画、手势(悬停、点击、拖拽)、滚动联动值、交错列表、模态框、标签页、菜单以及页面过渡。当用户提到 Motion、framer-motion、motion/react、AnimatePresence、layoutId、Next.js 中的页面过渡、动画模态框/菜单/标签页,或希望 React 组件感觉流畅生动时使用。
机器翻译查看英文原文
Build UI animation in React/Next.js with Motion for React (formerly Framer Motion) — micro-interactions, enter/exit with AnimatePresence, layout and shared-element animations, gestures (hover, tap, drag), scroll-linked values, staggered lists, modals, tabs, menus, and page transitions. Use whenever the user mentions Motion, framer-motion, motion/react, AnimatePresence, layoutId, page transition in Next.js, animated modal/menu/tabs, or wants React components to feel smooth and alive.
适用对象:React / Next.js。自动收录 · 待核查。
原作者说明节选
从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。
查看英文原文
原文涵盖的主题
- React Motion (Motion for React)
- 1. Setup
- 2. Core patterns
- 3. Page transitions in Next.js
- 4. Rules
- 5. Verify
New code: npm i motion and import { motion, AnimatePresence } from "motion/react". If the project already uses framer-motion, keep it consistent; to migrate, swap the package and change imports framer-motion → motion/react (API is the same). Next.js App Router: components using motion. must be client components ("use client"). For server components, use import as motion from "motion/react-client". Wrap the app once: Bundle-size sensitive? Use LazyMotion + m components with domAnimation features. Variants + stagger (lists, hero groups) Enter/exit (modals, toasts, dropdowns) — AnimatePresence must stay mounted; the child gets a stable key: Use mode="wait" when swapping one element for another (tab content, steps). Layout animation — layout prop animates size/position changes (accordion, filtering grid, reordering). Shared element: same layoutId in two places (tab underline, card → detail). Wrap related groups in . Micro-interactions Springs for physical feel (buttons, drag, toggles); tweens with ease-out for reveals. Scroll-linked For complex pinned/scrubbed storytelling, use GSAP instead (scroll-animation skill). Drag — drag="x", dragConstraints={ref}, dragElastic, onDragEnd with ve
这里只展示节选,请以完整原文和当前要求为准。
- 来源仓库
- KILN-skills/kiln
- 源文件
- skills/react-motion/SKILL.md
- 固定版本
- 555d7ea59d05910b4ef6fb39780da5f906be832b
来源与内容状态
本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。
原作者:KILN-skills/kiln · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-10T04:00:15.433Z。
分类由名称、说明与路径规则生成,分类不代表已核实适配。
许可与权利归属
MIT。第三方内容及版权归原作者,使用条件以原文为准。
许可原文 ↗本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。
限制与注意事项
- 元数据收录不代表本站已经安装、适配、实测或进行安全审查。