MCP HubMCP Hub
SKILL·AF65FA

expo-animation

expo
업데이트됨 5 days ago
2 조회
2,461
138
2,461
GitHub에서 보기
메타reactdesign

정보

이 스킬은 React Native와 Expo 앱을 위한 프로덕션 레디 애니메이션 코드를 생성하며, 스레딩, 제스처 통합, 물리 효과와 같은 결정을 처리합니다. Reanimated, Gesture Handler 및 Expo Router를 사용하여 시트, 전환, 햅틱 피드백과 같은 기능을 구현한 코드를 출력합니다. 부드럽고 네이티브 느낌의 애니메이션을 추가하거나 끊김 현상과 같은 성능 문제를 해결해야 할 때 사용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add expo/skills -a claude-code
플러그인 명령대체
/plugin add https://github.com/expo/skills
Git 클론대체
git clone https://github.com/expo/skills.git ~/.claude/skills/expo-animation

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

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:

  1. There is no hover. Every affordance the web puts in hover has to live in press, position, or nothing.
  2. 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.
  3. 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:

  1. Animating something that shouldn't animate. The gate below exists to produce zero lines of code sometimes.
  2. Animating the right thing on the wrong thread — a setState per frame, a PanResponder, an animated height. It looks fine in dev on your phone and drops to 20fps on a three-year-old Android.

Hard Rules

  1. Run the sequence in order. Steps 1 and 2 gate everything.
  2. Reanimated, not core Animated. Core Animated can't be driven by a gesture without crossing the bridge, and useNativeDriver refuses anything but transform and opacity anyway. Reanimated worklets run on the UI thread and keep running while JS is busy.
  3. No approximated values. Curves and spring configs come from the tables below.
  4. Reduced motion ships with the animation, not as a follow-up.
  5. 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?

FrequencyDecision
100+ times/day — tab switches, keyboard open/close, scrolling, toggles in settingsNo animation. Platform default or nothing. Stop here.
Tens of times/day — press feedback, list navigation, row selectionNear-imperceptible only: under 150ms, or nothing
Occasional — sheets, modals, toasts, onboarding stepsStandard animation
Rare / first-time — success states, empty-state illustrations, celebrationThe 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.

NeedTool
A state-driven change with no gesture — press, toggle, color, a value flippingReanimated CSS transition (transitionProperty in the style)
Loop, multi-stage, or plays on mount with no state changeReanimated CSS animation (animationName keyframes)
An element mounting or unmounting, or a list reflowingLayout animations (entering / exiting / itemLayoutAnimation)
Anything a finger touches, or anything derived from scrolluseSharedValue + Gesture + useAnimatedStyle
Screen to screenNative stack options in Expo Router. Never hand-roll this
A bottom sheet that is its own screenpresentation: 'formSheet' — it's a real UISheetPresentationController, free and correct
Tab barNativeTabs (from expo-router/unstable-native-tabs) — the platform's real tab bar, its behaviors and transitions included
Context menu, press-and-hold previewLink.Menu / Link.Preview (Expo Router, iOS-only) — native menus and peek, never rebuilt in JS
Header that collapses into a large titleheaderLargeTitleEnabled on the native stack (iOS-only; headerLargeTitle is deprecated) — not a scroll worklet
Pull to refreshRefreshControl — hand-roll only when it's a signature interaction (see the threshold recipe)
UI that tracks the keyboardreact-native-keyboard-controller — the keyboard's real position, frame by frame, on the UI thread
Vector illustration, celebration, empty stateLottie — for illustration only, never for UI state
A huge animated scene, freeform drawing@shopify/react-native-skia — a canvas, for when the view hierarchy itself is the bottleneck

Reach for a shared value only when the value is continuous or interruptible. A press scale is a CSS transition; a drag is a shared value. Using a worklet for a two-state toggle is the mobile equivalent of installing a motion library for a fade.

Dependencies. Install with npx expo install <package> — it resolves the version that matches the project's SDK, which plain npm install won't:

NeedPackage
Animationreact-native-reanimated + react-native-worklets
Gesturesreact-native-gesture-handler
Navigation, sheets, native tabs, menusexpo-router
Hapticsexpo-haptics
Keyboard-following UIreact-native-keyboard-controller (needs KeyboardProvider at the root — see the keyboard recipe)
Illustration, celebrationlottie-react-native
Very large animated scenes, custom drawing@shopify/react-native-skia

4. Pick the properties

  • transform and opacity are free. Everything else is a layout pass. width, height, margin, padding, flex, top, left, gap re-run Yoga on every frame for that node and its siblings.
  • The one exception: an absolutely positioned element with no children — a tab pill, a progress bar fill. It's out of flow, so nothing else re-lays-out, and animating width keeps the corner radius that scaleX would smear.
  • Never scale(0). Start from scale(0.9–0.97) + opacity: 0. Nothing in the real world appears from nothing.
  • transform is an array and order matters[{ translateY }, { scale }] scales after moving; reversed, the translate gets scaled too. Keep translate first unless you want the multiplication.
  • Android shadows are elevation, and animating elevation re-renders the shadow every frame. Animate opacity of a pre-shadowed layer instead.
  • Never animate BlurView intensity. On Android it re-renders the blur each frame. Crossfade the opacity of a static BlurView instead.
  • Percentages work in translate and are relative to the element's own size — translateY('100%') moves a sheet by its own height whatever its content.

5. Timing or spring

If a finger was involved, use a spring. Springs carry velocity through an interruption; timing curves restart. Everything else uses timing.

Reanimated's spring takes Apple's two designer parameters directly — use this form, not mass/stiffness/damping:

InteractionConfig
Default settle, no overshoot{ duration: 400, dampingRatio: 1 }
Reposition / snap back after a drag{ duration: 400, dampingRatio: 0.8, velocity }
Sheet, drawer{ duration: 300, dampingRatio: 0.8, velocity }
Must not pass a hard edgeadd overshootClamping: true

Bounce only when the gesture carried momentum. Overshoot on a menu that faded in feels wrong; overshoot on a card you flicked feels right.

Easing, for everything without a finger on it:

SituationEasing
Entering or exitingease-out
Moving / morphing on screenease-in-out
Constant motion (progress, marquee)linear
Defaultease-out

Never ease-in on UI. It starts slow, delaying the exact moment the user is watching. Reanimated's built-ins are as weak as CSS's — use these:

import { Easing } from 'react-native-reanimated';

const EASE_OUT = Easing.bezier(0.23, 1, 0.32, 1);      // strong ease-out for UI
const EASE_IN_OUT = Easing.bezier(0.77, 0, 0.175, 1);  // on-screen movement
const EASE_SHEET = Easing.bezier(0.32, 0.72, 0, 1);    // iOS sheet curve

Duration:

ElementDuration
Press feedback100–150ms
Toggle, chip, small state change150–200ms
Sheet, modal, drawerspring, ~300ms perceived
Screen transitionthe platform default — don't override it

Mobile UI animations stay under 300ms, same as web. The platform's own transitions are longer (iOS push is 350ms); match the platform for navigation, beat it everywhere else.

6. Keep it off the JS thread

This is the mobile-specific craft, and it's where most React Native motion dies.

  • Never setState from a gesture or scroll handler. One React render per frame is the single biggest cause of jank in RN apps. Shared value → useAnimatedStyle, and React never re-renders at all.
  • Never schedule back to the RN runtime inside onUpdate or a scroll handler. scheduleOnRN(fn, ...args) from react-native-worklets — the Reanimated 4 replacement for the deprecated runOnJS(fn)(...args) — queues an RN-runtime call, and in onUpdate that's 60–120× per second. It belongs in onEnd, or in a useAnimatedReaction that fires when a value crosses a threshold.
  • Never read a shared value during render (translateY.get() in JSX). It's a snapshot that never updates and it silently desyncs. Never write one during render either — it fires mid-reconciliation, and a re-render you didn't cause replays the write. Touch shared values only in worklets, handlers, and effects.
  • Use .get() / .set(), not .value. Same API, but direct .value access is the form the React Compiler can't see through — the Reanimated docs call get/set the compiler-safe way. set also takes a functional update: sv.set((v) => v + 1).
  • Functions called from a worklet need 'worklet' as their first line, or they throw at runtime on device while working fine in the debugger.

7. Press, not hover

Every hover affordance from the web has to be redesigned, not ported.

  • Feedback on press-in, commit on press-out. Waiting for the tap to complete before showing anything feels dead — this is the latency the user actually perceives.
  • scale: 0.97 in 100–150ms on any pressable, Pressable + a CSS transition. scale takes the label and icons with it, which is what makes it read as physical.
  • 44×44pt minimum touch target (48dp Android). If the visual is smaller, add hitSlop — don't grow the visual.
  • pressRetentionOffset so a finger drifting a few pixels doesn't cancel a press the user meant.
  • Android ripple only in a Material-styled app. In a custom-designed app, the same scale on both platforms is more coherent than a ripple on one.

8. Haptics

Mobile has a sense the web doesn't. Use it sparingly and it becomes the thing that makes the app feel expensive; use it everywhere and users turn it off.

MomentCall
A value ticks past a step — picker, slider detent, segmented controlHaptics.selectionAsync()
Something snaps home, a sheet detent catches, a drag commitsHaptics.impactAsync(ImpactFeedbackStyle.Light)
A heavy object lands, a destructive action firesHaptics.impactAsync(ImpactFeedbackStyle.Medium)
Operation succeeded or failedHaptics.notificationAsync(NotificationFeedbackType.Success / Error)

Three rules, and they're absolute:

  • Same frame as the visual. A haptic that lags its animation reads as a glitch, not as feedback. Fire it at the causal moment — the detent catching — not when the animation finishes.
  • One per user action. Never on scroll, never per frame, never on an entrance animation the user didn't cause.
  • Never the only feedback. Haptics are off system-wide for many users, and silent on most Android hardware. The visual has to stand alone.

From a worklet, haptics must be scheduled back to the RN runtime: scheduleOnRN(Haptics.selectionAsync).

9. Reduced motion and accessibility

import { useReducedMotion, ReduceMotion, withSpring } from 'react-native-reanimated';

const reduced = useReducedMotion();
const y = useSharedValue(reduced ? 0 : SHEET_HEIGHT);

// or let each animation decide
withSpring(0, { duration: 300, dampingRatio: 0.8, reduceMotion: ReduceMotion.System });

Reduced motion means fewer and gentler, not zero: keep opacity and color changes that explain a state change, drop translation, scale, parallax and overshoot. Screen transitions become animation: 'fade'.

Text scales. allowFontScaling is on by default, so any height you measured at default type size is wrong at 200%. Never animate to a hardcoded height — measure with onLayout, or animate a transform instead.

Setup that silently breaks motion

Check these first when "the animation just doesn't run":

  • Install through Expo so versions match the SDK: npx expo install react-native-reanimated react-native-worklets. In an Expo project, babel-preset-expo configures the worklets Babel plugin automatically — no babel.config.js step. Only a bare RN project without that preset adds the plugin manually, and there it must be last in the list. A missing or misplaced plugin doesn't silently fall back anymore — it throws Failed to create a worklet at runtime.
  • GestureHandlerRootView must wrap the app, or gestures do nothing with no error.
  • Reanimated 4 requires the New Architecture.
  • Expo Go is not a performance environment. Judge feel in a release build; a dev build's JS thread is slow enough to hide exactly the problems you're looking for.

120fps

On ProMotion iPhones, third-party animations are capped at 60fps unless CADisableMinimumFrameDurationOnPhone is set. Recent Expo SDKs set it by default — confirm it's there, and add it if not:

{ "expo": { "ios": { "infoPlist": { "CADisableMinimumFrameDurationOnPhone": true } } } }

Then the frame budget is 8ms, not 16. This is also why a UI-thread animation matters more on mobile than it does on web.

Recipes

For ready-to-build implementations — press feedback, drag-to-dismiss sheet, swipe-to-delete, collapsing header, list entrances, keyboard-synced UI, tab indicator, screen transitions — see RECIPES.md. Load it whenever the request matches one; start from the recipe rather than from a blank file.

Never Ship

NeverInstead
PanResponderGesture.Pan() from gesture-handler
setState in a gesture or scroll handlershared value + useAnimatedStyle
runOnJS (deprecated in Reanimated 4)scheduleOnRN from react-native-worklets
scheduleOnRN per frameonEnd, or useAnimatedReaction at a threshold
Reading or writing a shared value during render.get() / .set() in worklets, handlers, effects
Core Animated for anything a finger touchesReanimated
Animating height / width / margin / flex / toptransform + opacity (absolute, childless elements exempt)
Animating BlurView intensity or Android elevationcrossfade a static layer
entering on a virtualized list rowanimate the container, or itemLayoutAnimation
A screen transition rebuilt in JSnative stack animation
Sliding between tabsanimation: 'none'
Easing.in(...) on a UI elementEasing.bezier(0.23, 1, 0.32, 1)
scale(0) entrancescale(0.95) + opacity: 0
Distance-only dismissal thresholdvelocity or distance — a flick is enough
Hard stop at a boundaryrubber-band resistance
A haptic per frame, or as the only feedbackone per commit, always paired with a visual
Judging feel in Expo Go or the simulatorrelease build, slowest supported device

Output

Write the code. Then, in at most a few lines:

  • The gate result — frequency tier and named purpose. Say what you rejected and why.
  • The ingredients — tool, properties, spring or curve + duration, thread.
  • What to feel-check on device — gestures, velocity handoff and haptic timing cannot be judged from code. Name what to try: flick it, interrupt it mid-flight, reverse it, run it on the slowest Android you have.

The code is the deliverable. Don't pad it into a report.

Tone

Opinionated and brief. When the honest answer is "this shouldn't animate," or "this needs a real device before I can tell you if it's right," give it.

Submitting Feedback

If you encounter errors, misleading or outdated information in this skill, report it so Expo can improve:

npx --yes submit-expo-feedback@latest --category skills --subject "expo-animation" "<actionable feedback>"

Only submit when you have something specific and actionable to report. Include as much relevant context as possible. If an AI agent repeatedly failed or the user had to take over an Expo task, load the expo-skill-feedback skill and follow its eval-candidate flow instead of reusing the command above.

GitHub 저장소

expo/skills
경로: plugins/expo/skills/expo-animation
0
FAQ

자주 묻는 질문

expo-animation Skill이란 무엇인가요?

expo-animation은(는) expo이(가) 만든 Claude Skill입니다. Skill은 Claude가 필요할 때 불러오는 지침과 리소스를 묶어 추가 프롬프트 없이 expo-animation 관련 작업을 수행할 수 있게 합니다.

expo-animation은(는) 어떻게 설치하나요?

이 페이지의 설치 명령을 사용하세요. expo-animation을(를) Claude Code 플러그인으로 추가하거나 저장소를 skills 디렉터리에 복제한 다음 Claude를 다시 시작해 Skill을 불러옵니다.

expo-animation은(는) 어떤 카테고리에 속하나요?

expo-animation은(는) 메타 카테고리에 속합니다.

expo-animation은(는) 무료로 사용할 수 있나요?

네. expo-animation은(는) AIMCP에 등록되어 있으며 무료로 설치할 수 있습니다.

연관 스킬

content-collections
메타

이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.

스킬 보기
polymarket
메타

이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.

스킬 보기
creating-opencode-plugins
메타

이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.

스킬 보기
sglang
메타

SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.

스킬 보기