mcpField
F
framer-motion

framer-motion

github.com/pproenca设计与 UI2201.1k 次安装11 周前更新
代码仓库

关于 framer-motion

面向 React 开发者的 Framer Motion 动画优化指南,提供按影响程度排列的规则,涵盖性能、布局、滚动和手势动画。

主要功能

  1. 01涵盖 9 类优化主题
  2. 02按影响程度排列规则
  3. 03提供动画代码实践建议
  4. 04包含参考文件与规则模板

适用场景

  1. 01优化动画密集型 React 应用
  2. 02减少动画期间不必要的重渲染
  3. 03实现布局、滚动或手势动画

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/pproenca/dot-skills --skill framer-motion

安装后在 Claude Code 中输入/framer-motion确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

metadata.json
assets/templates/
_template.md
references/
_sections.md
anim-hardware-acceleration.md
anim-independent-transforms.md
anim-keyframes-array.md
anim-opacity-filter.md
anim-transform-properties.md
anim-will-change.md
bundle-dom-animation.md
bundle-dynamic-features.md
bundle-lazy-motion.md
bundle-strict-mode.md
bundle-use-animate-mini.md
exit-animate-presence.md
exit-mode-wait.md
exit-unique-keys.md
gesture-drag-constraints.md
gesture-drag-elastic.md
gesture-tap-cancel.md
gesture-variants-flow.md
gesture-while-props.md
layout-dependency.md
layout-group.md
layout-id-shared.md
layout-position-size.md
layout-scroll.md
rerender-animate-prop.md
rerender-motion-value-event.md
rerender-motion-value.md

详细介绍

Framer Motion 社区最佳实践

面向 React 应用中 Framer Motion 动画的全面性能优化指南。包含 9 个类别中的 42 条规则,按影响程度排序,帮助自动重构和代码生成。

适用场景

在以下情况下参考这些指南:

  • 使用 Framer Motion 为 React 组件添加动画
  • 优化动画密集型应用的包体积
  • 避免动画过程中不必要的重新渲染
  • 实现布局过渡或共享元素动画
  • 构建与滚动联动或基于手势的交互

按优先级划分的规则类别

优先级类别影响前缀
1包优化CRITICALbundle-
2防止重新渲染CRITICALrerender-
3动画属性HIGHanim-
4布局动画HIGHlayout-
5滚动动画MEDIUM-HIGHscroll-
6手势优化MEDIUMgesture-
7弹簧与物理效果MEDIUMspring-
8SVG 与路径动画LOW-MEDIUMsvg-
9退出动画LOWexit-

快速参考

1. 包优化(CRITICAL)
2. 防止重新渲染(CRITICAL)
3. 动画属性(HIGH)
4. 布局动画(HIGH)
5. 滚动动画(中高)
6. 手势优化(中)
7. 弹簧与物理效果(中)
8. SVG 与路径动画(低中)
9. 退出动画(低)

使用方法

阅读各个参考文件,了解详细说明和代码示例:

参考文件

文件描述
references/_sections.md类别定义和排序
assets/templates/_template.md新规则模板
metadata.json版本和参考信息

评论

支持 Markdown