expo-animation
Skill này làm gì
Công cụ này giúp tạo các hiệu ứng chuyển động mượt mà và phản hồi nhanh cho ứng dụng di động, đảm bảo chúng hoạt động tốt trên nhiều thiết bị.
Khi nào nên dùng
- ✓Khi bạn muốn một phần tử di chuyển mượt mà khi được chạm vào.
- ✓Khi tạo chuyển cảnh giữa các màn hình hoặc các phần tử.
- ✓Khi muốn thêm hiệu ứng hình ảnh để nâng cao trải nghiệm người dùng.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/expo-animation/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tạo hiệu ứng mờ dần xuất hiện cho một nút bấm khi nó hiện trên màn hình.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ dùng các thư viện cụ thể (như Reanimated) chạy trên đúng 'luồng' của điện thoại, nhờ đó hiệu ứng không bị giật. Trọng tâm là làm cho hiệu ứng chạy mà không ảnh hưởng đến phần còn lại của ứng dụng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 |
…
Câu hỏi thường gặp
Tại sao không dùng hiệu ứng cho mọi thứ?
Các hiệu ứng không cần thiết có thể làm chậm ứng dụng. Công cụ này giúp quyết định một hiệu ứng có thực sự hữu ích hay tốt hơn là không có.
'Worklets' là gì?
Đó là những đoạn mã nhỏ chạy trực tiếp trên 'UI thread' (luồng xử lý giao diện), giúp các hiệu ứng rất nhanh và mượt.
Vì sao phải chú ý đến các thiết bị chậm hơn?
Để đảm bảo hiệu ứng hoạt động tốt với mọi người dùng, kể cả những người có điện thoại cũ hoặc ít sức mạnh hơn.
Chi tiết
Mô tả gốc của tác giả
Curated upstream guidance for Expo Animation; use when the workflow matches the user goal.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #4568
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
android-clean-architecture
280kGiúp agent của bạn tổ chức dự án Android hiệu quả, cấu trúc code để việc bảo trì và phát triển tính năng mới dễ dàng hơn.
compose-multiplatform-patterns
280kGiúp agent của bạn dùng các mẫu Compose Multiplatform và Jetpack Compose trong dự án KMP, gồm trạng thái, điều hướng, giao diện và hiệu năng.
dart-flutter-patterns
280kGiúp agent của bạn viết code cho ứng dụng Dart và Flutter. Agent dùng các mẫu hiện đại để tạo ứng dụng vững chắc và dễ quản lý.