framer-motion by pproenca/dot-skills
npx skills add https://github.com/pproenca/dot-skills --skill framer-motionReact 应用程序中 Framer Motion 动画的全面性能优化指南。包含 9 个类别共 42 条规则,按影响优先级排序,以指导自动化重构和代码生成。
在以下情况下参考这些指南:
| 优先级 | 类别 | 影响 | 前缀 |
|---|---|---|---|
| 1 | 打包优化 | 关键 | bundle- |
| 2 | 防止重新渲染 | 关键 | rerender- |
| 3 | 动画属性 | 高 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
anim-| 4 | 布局动画 | 高 | layout- |
| 5 | 滚动动画 | 中高 | scroll- |
| 6 | 手势优化 | 中 | gesture- |
| 7 | 弹簧与物理 | 中 | spring- |
| 8 | SVG 与路径动画 | 低中 | svg- |
| 9 | 退出动画 | 低 | exit- |
bundle-lazy-motion - 使用 LazyMotion 和 m 组件代替 motionbundle-dynamic-features - 动态导入 motion 功能bundle-dom-animation - 使用 domAnimation 进行基本动画bundle-use-animate-mini - 在简单情况下使用 mini useAnimatebundle-strict-mode - 启用严格模式以捕获意外导入rerender-motion-value - 使用 useMotionValue 代替 useStatererender-use-transform - 使用 useTransform 派生值rerender-stable-callbacks - 保持动画回调稳定rerender-variants-object - 在组件外部定义变体rerender-animate-prop - 使用稳定的 animate 值rerender-motion-value-event - 使用 motion value 事件anim-transform-properties - 对 transform 属性进行动画处理anim-opacity-filter - 视觉特效首选 opacity 和 filteranim-hardware-acceleration - 利用硬件加速anim-will-change - 审慎使用 willChange 属性anim-independent-transforms - 独立地对 transform 进行动画处理anim-keyframes-array - 使用关键帧数组处理序列layout-dependency - 使用 layoutDependency 限制测量layout-position-size - 适当地使用 layout="position" 或 "size"layout-group - 对相关的布局动画进行分组layout-id-shared - 使用 layoutId 实现共享元素过渡layout-scroll - 为可滚动的祖先元素添加 layoutScrollscroll-use-scroll - 使用 useScroll 钩子实现滚动关联动画scroll-use-spring-smooth - 使用 useSpring 实现平滑滚动动画scroll-element-tracking - 跟踪进入视口的特定元素scroll-offset-configuration - 配置滚动偏移量scroll-container-ref - 在特定容器内跟踪滚动gesture-while-props - 使用 whileHover/whileTap 代替处理函数gesture-variants-flow - 让手势变体流向子元素gesture-drag-constraints - 使用 dragConstraints ref 设置边界gesture-drag-elastic - 配置 dragElastic 以获得自然感觉gesture-tap-cancel - 使用 onTapCancel 处理中断的手势spring-physics-based - 使用基于物理的弹簧实现可中断性spring-damping-ratio - 配置阻尼以控制振荡spring-mass-inertia - 调整质量以获得更重或更轻的感觉spring-use-spring-hook - 使用 useSpring 处理响应式值svg-path-length - 使用 pathLength 实现线条绘制动画svg-motion-components - 使用 motion.path 和 motion.circlesvg-viewbox-animation - 对 viewBox 进行动画处理以实现缩放效果svg-morph-matching-points - 变形时匹配点数exit-animate-presence - 用 AnimatePresence 包裹条件渲染exit-unique-keys - 为 AnimatePresence 的子元素提供唯一键exit-mode-wait - 使用 mode="wait" 实现顺序过渡阅读各个参考文件以获取详细说明和代码示例:
| 文件 | 描述 |
|---|---|
| references/_sections.md | 类别定义和排序 |
| assets/templates/_template.md | 新规则模板 |
| metadata.json | 版本和参考信息 |
每周安装量
197
代码仓库
GitHub 星标数
85
首次出现
2026年2月12日
安全审计
安装于
opencode184
gemini-cli183
codex181
github-copilot177
cursor173
kimi-cli155
Comprehensive performance optimization guide for Framer Motion animations in React applications. Contains 42 rules across 9 categories, prioritized by impact to guide automated refactoring and code generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Bundle Optimization | CRITICAL | bundle- |
| 2 | Re-render Prevention | CRITICAL | rerender- |
| 3 | Animation Properties | HIGH | anim- |
| 4 | Layout Animations | HIGH | layout- |
| 5 | Scroll Animations | MEDIUM-HIGH | scroll- |
| 6 | Gesture Optimization | MEDIUM | gesture- |
| 7 | Spring & Physics | MEDIUM | spring- |
| 8 | SVG & Path Animations | LOW-MEDIUM | svg- |
| 9 | Exit Animations | LOW | exit- |
bundle-lazy-motion - Use LazyMotion and m component instead of motionbundle-dynamic-features - Dynamically import motion featuresbundle-dom-animation - Use domAnimation for basic animationsbundle-use-animate-mini - Use mini useAnimate for simple casesbundle-strict-mode - Enable strict mode to catch accidental importsrerender-motion-value - Use useMotionValue instead of useStatererender-use-transform - Derive values with useTransformrerender-stable-callbacks - Keep animation callbacks stablererender-variants-object - Define variants outside componentrerender-animate-prop - Use stable animate valuesanim-transform-properties - Animate transform propertiesanim-opacity-filter - Prefer opacity and filter for visual effectsanim-hardware-acceleration - Leverage hardware accelerationanim-will-change - Use willChange prop judiciouslyanim-independent-transforms - Animate transforms independentlylayout-dependency - Use layoutDependency to limit measurementslayout-position-size - Use layout="position" or "size" appropriatelylayout-group - Group related layout animationslayout-id-shared - Use layoutId for shared element transitionslayout-scroll - Add layoutScroll to scrollable ancestorsscroll-use-scroll - Use useScroll hook for scroll-linked animationsscroll-use-spring-smooth - Smooth scroll animations with useSpringscroll-element-tracking - Track specific elements entering viewportscroll-offset-configuration - Configure scroll offsetsscroll-container-ref - Track scroll within specific containersgesture-while-props - Use whileHover/whileTap instead of handlersgesture-variants-flow - Let gesture variants flow to childrengesture-drag-constraints - Use dragConstraints ref for boundariesgesture-drag-elastic - Configure dragElastic for natural feelgesture-tap-cancel - Use onTapCancel for interrupted gesturesspring-physics-based - Use physics-based springs for interruptibilityspring-damping-ratio - Configure damping to control oscillationspring-mass-inertia - Adjust mass for heavier/lighter feelspring-use-spring-hook - Use useSpring for reactive valuessvg-path-length - Use pathLength for line drawing animationssvg-motion-components - Use motion.path and motion.circlesvg-viewbox-animation - Animate viewBox for zoom effectssvg-morph-matching-points - Match point counts for morphingexit-animate-presence - Wrap conditional renders with AnimatePresenceexit-unique-keys - Provide unique keys for AnimatePresence childrenexit-mode-wait - Use mode="wait" for sequential transitionsRead individual reference files for detailed explanations and code examples:
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
Weekly Installs
197
Repository
GitHub Stars
85
First Seen
Feb 12, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode184
gemini-cli183
codex181
github-copilot177
cursor173
kimi-cli155
Tailwind CSS v4 + shadcn/ui 生产级技术栈配置指南与最佳实践
2,600 周安装
rerender-motion-value-eventanim-keyframes-array