React Native Reanimated Code Generator
Generate performant animation code using React Native Reanimated. Supports both v3 and v4.
Version Detection
Check the project's package.json to determine the version:
- v4 (New Architecture only): requires
react-native-workletsas separate dependency - v3 (supports Legacy and New Architecture): single package install
Setup
Reanimated v4 (latest)
Babel plugin: 'react-native-worklets/plugin' (must be last in plugins list).
For Expo: no Babel config needed. Run npx expo prebuild after install.
Reanimated v3
Babel plugin: 'react-native-reanimated/plugin' (must be last in plugins list).
Core Pattern
Every animation follows three steps:
Animation Selection
Spring tuning: lower damping (5–8) = more bounce, higher stiffness (150–200) = snappier, higher mass (2–3) = heavier.
Quick Patterns
Fade
Slide from side
Scale on press
Interpolation
Scroll-linked animation
Or simpler with useScrollOffset (v4) / useScrollViewOffset (v3):
Layout Animations (Mount/Unmount)
Built-in presets — no shared values needed:
Presets: FadeIn/Out, SlideIn/OutLeft/Right/Up/Down, ZoomIn/Out, BounceIn/Out, FlipInEasyX/Y, LightSpeedIn/Out, PinwheelIn/Out, RollIn/Out, RotateIn/Out, StretchIn/Out.
Modifiers: .duration(ms), .delay(ms), .springify(), .damping(n), .stiffness(n), .randomDelay(), .reduceMotion(), .withCallback().
Layout Transitions (position/size changes)
Animate when component position or size changes:
Transitions: LinearTransition, SequencedTransition, FadingTransition, JumpingTransition, CurvedTransition, EntryExitTransition.
Keyframe Animations (complex entering/exiting)
For custom animations, layout transitions, and list animations, read references/layout-animations.md.
CSS Animations (v4 only)
Declarative CSS-like animations using style props directly:
Supported props: animationName, animationDuration, animationDelay, animationIterationCount, animationDirection, animationFillMode, animationPlayState, animationTimingFunction.
CSS Transitions (v4 only)
Automatic transitions when style values change:
Multiple properties: transitionProperty: ['width', 'opacity', 'transform'] with matching transitionDuration: ['300ms', '200ms', '500ms'].
For detailed CSS animations/transitions reference (keyframes, timing functions, examples), read references/css-animations-detailed.md.
Shared Element Transitions (Experimental)
Animate components between screens during navigation:
Requires @react-navigation/native-stack and feature flag. For setup and customization, read references/shared-element-transitions.md.
Gesture Integration
For drag, pinch, fling, and other gesture-driven animations, read references/gesture-patterns.md.
Requires: react-native-gesture-handler + <GestureHandlerRootView> at app root.
Full API Reference
For complete hook signatures, animation parameters, v3↔v4 differences, and advanced APIs, read references/api-reference.md.
Worklets & Advanced APIs
For understanding worklets, 'worklet' directive, runOnJS/runOnUI, useAnimatedReaction, useFrameCallback, measure, dispatchCommand, and performance tips, read references/worklets-advanced.md.
Real-World Component Patterns
For full implementations of accordion, bottom sheet, flip card, and FAB, read references/component-patterns.md.
Testing, Colors & Supported Properties
For testing animations with Jest, animating colors with interpolateColor, and the full list of animatable properties by platform, read references/testing-and-properties.md.
Rules
- Always use
Animated.View/Text/Image/ScrollView/FlatList— never animate plain RN components - v4: use
runOnJS/runOnUI(re-exported), or importscheduleOnRN/scheduleOnUIfromreact-native-worklets - v3: use
runOnJS(fn)()for heavy JS-thread logic - Always use
Extrapolation.CLAMPwithinterpolateunless you explicitly want extrapolation - Combine:
withSequence(withTiming(1.2, {duration: 100}), withSpring(1)) - Use
useReducedMotion()to respect accessibility settings - Test on real devices — simulator performance differs significantly
- v4:
useAnimatedKeyboardis deprecated → usereact-native-keyboard-controller
Based on react-native-reanimated by Software Mansion (MIT License)


