Loading...
Loading...
Compare original and translation side by side
motionframer-motionmotion/reactmotionframer-motionmotion/react| Pattern | API / Props |
|---|---|
| Fade in on mount | |
| Exit animations | |
| Staggered list | |
| Hover / tap / focus | |
| Drag | |
| Scroll-triggered | |
| Scroll-linked/parallax | |
| Progress indicator | |
| Layout animation | |
| Shared element | |
| Layout group | |
| Page transition | |
| SVG path drawing | |
| Animated counter | |
| Imperative control | |
| Custom components | |
| Bundle optimization | |
| Reduced motion | |
| 模式 | API/Props |
|---|---|
| 挂载时淡入 | |
| 退出动画 | |
| 交错列表 | 带有 |
| 悬停/点击/聚焦 | |
| 拖拽 | |
| 滚动触发动画 | |
| 滚动关联/视差效果 | |
| 进度指示器 | |
| 布局动画 | |
| 共享元素过渡 | |
| 布局组 | |
| 页面过渡 | |
| SVG路径绘制动画 | |
| 数字计数器动画 | |
| 命令式控制 | |
| 自定义组件 | |
| 包体积优化 | |
| 减少动画模式 | |
| Mistake | Correct Pattern |
|---|---|
| AnimatePresence inside a conditional | Keep AnimatePresence mounted; place conditional content inside it |
Missing unique | Add unique |
Tailwind | Remove Tailwind transition classes to avoid stuttering |
Importing from | Use |
| Animating 50+ items without virtualization | Use react-window or @tanstack/react-virtual for large lists |
| Full 34 KB bundle for simple animations | Use LazyMotion + domAnimation (4.6 KB) or useAnimate (2.3 KB) |
Missing | Add directive or use |
Animating | Use |
No | Wrap app in |
| 错误做法 | 正确方案 |
|---|---|
| 在条件语句内使用AnimatePresence | 保持AnimatePresence挂载,将条件内容置于其内部 |
AnimatePresence子元素缺少唯一 | 为每个直接子元素添加唯一 |
将Tailwind | 移除Tailwind过渡类以避免动画卡顿 |
从 | 使用 |
| 不对50+个元素的列表做虚拟化处理就进行动画 | 对大型列表使用react-window或@tanstack/react-virtual |
| 简单动画使用完整版34 KB包 | 使用LazyMotion + domAnimation(4.6 KB)或useAnimate(2.3 KB) |
Next.js App Router中缺少 | 添加指令或使用 |
直接动画 | 使用 |
未处理 | 用 |
ExploreTaskPlanIf theskill is available, delegate animation token definitions and motion design guidelines to it.design-system
ExploreTaskPlan如果技能可用,请将动画令牌定义和动效设计准则的任务委派给它。design-system