expo-animation
它能做什么
这个工具可以帮你为移动应用制作流畅、灵敏的动画,并确保它们在各种设备上都能良好运行。
适用场景
- ✓当你希望某个元素在被触摸时平滑地移动。
- ✓当你要在页面或元素之间添加过渡效果时。
- ✓当你想添加视觉效果来提升用户体验时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/expo-animation/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“为按钮制作一个淡入动画,让它在出现在屏幕上时逐渐显示。”
每周 5 个新技能,1 分钟读完。
工作原理
它会使用特定的工具(比如 Reanimated),让动画运行在手机正确的“线程”上,这样动画就不会卡顿。重点是让动画顺畅运行,同时不影响应用的其他部分。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
When to Use
- Use when this upstream workflow matches the user's stated goal.
- Use when the task requires the procedures documented in this skill.
Building Animations in Expo
This skill was created in collaboration with Emil Kowalski and can also be found in the emilkowalski/skills repository, along with other useful animation skills.
A construction skill for React Native. It turns a request for motion into an implementation that survives a strict review on a real device — not in the simulator, not on a flagship phone in dev mode.
Mobile changes three things about animation, and everything in this skill follows from them:
- There is no hover. Every affordance the web puts in hover has to live in press, position, or nothing.
- There are two runtimes. Worklets (Reanimated 4) makes this explicit: the React Native runtime, where React renders and your app logic runs, and the UI runtime, where worklets run every frame (plus optional worker runtimes for background work). An animation that touches the RN runtime stutters the moment the app does anything else. The whole craft is keeping motion on the UI runtime.
- The user's finger is on the element. Gestures are the primary input, so interruptibility and velocity handoff aren't polish — they're the baseline.
Operating Posture
You are a senior mobile engineer building the animation yourself. Make the call, state the reasoning in one line, write the code. Never present motion options as a menu.
Two failure modes, and the first is worse:
- Animating something that shouldn't animate. The gate below exists to produce zero lines of code sometimes.
- Animating the right thing on the wrong thread — a
setStateper frame, aPanResponder, an animatedheight. It looks fine in dev on your phone and drops to 20fps on a three-year-old Android.
Hard Rules
- Run the sequence in order. Steps 1 and 2 gate everything.
- Reanimated, not core
Animated. CoreAnimatedcan't be driven by a gesture without crossing the bridge, anduseNativeDriverrefuses anything but transform and opacity anyway. Reanimated worklets run on the UI thread and keep running while JS is busy. - No approximated values. Curves and spring configs come from the tables below.
- Reduced motion ships with the animation, not as a follow-up.
- Feel is judged on a release build on the slowest device you support. Nothing else counts as verified.
The Build Sequence
1. Should this animate at all?
| Frequency | Decision |
|---|---|
| 100+ times/day — tab switches, keyboard open/close, scrolling, toggles in settings | No animation. Platform default or nothing. Stop here. |
| Tens of times/day — press feedback, list navigation, row selection | Near-imperceptible only: under 150ms, or nothing |
| Occasional — sheets, modals, toasts, onboarding steps | Standard animation |
| Rare / first-time — success states, empty-state illustrations, celebration | The delight budget lives here |
Tab switches never slide. Tabs are peers, not a hierarchy — sliding implies depth that isn't there, and the user pays for it dozens of times a session. animation: 'none'.
If the request fails this gate, say so and don't write it.
2. What is the purpose?
Name it in one word before continuing: feedback, spatial consistency, state indication, preventing a jarring change, explanation, or delight (rare tier only).
Can't name it? Don't build it.
3. Pick the tool — cheapest that works
Walk down; stop at the first that fits.
| Need | Tool |
|---|---|
| A state-driven change with no gesture — press, toggle, color, a value flipping | Reanimated CSS transition (transitionProperty in the style) |
| Loop, multi-stage, or plays on mount with no state change | Reanimated CSS animation (animationName keyframes) |
| An element mounting or unmounting, or a list reflowing | Layout animations (entering / exiting / itemLayoutAnimation) |
| Anything a finger touches, or anything derived from scroll | useSharedValue + Gesture + useAnimatedStyle |
| Screen to screen | Native stack options in Expo Router. Never hand-roll this |
| A bottom sheet that is its own screen | presentation: 'formSheet' — it's a real UISheetPresentationController, free and correct |
…
常见问题
为什么不把每个地方都加上动画?
不必要的动画会拖慢应用。这个工具可以帮你判断某个动画是否真的有用,或者干脆不加会更好。
什么是 “worklets”?
它们是直接在 “UI 线程”(负责处理界面的线程)上运行的小段代码,能让动画非常快速、流畅。
为什么要特别关注性能较差的设备?
为了确保动画对所有用户都运行良好,包括使用老旧或性能较弱手机的用户。
详情
作者的原始描述
Curated upstream guidance for Expo Animation; use when the workflow matches the user goal.
热度
- GitHub 星标
- 48k
- 排名
- #4568
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。