Loading...
Loading...
Builds performant animations and gesture-driven interactions in React Native (Expo) apps using React Native Reanimated v4 and React Native Gesture Handler (GestureDetector / hook API). Use when implementing UI motion, transitions, layout/entering/exiting animations, CSS-style transitions/animations, interactive gestures (pan/pinch/swipe/drag), scroll-linked animations, worklets/shared values, or debugging animation performance and threading issues.
npx skill4agent add tristanmanchester/agent-skills animating-react-native-exponpx expo install react-native-reanimated react-native-worklets react-native-gesture-handlernode {baseDir}/scripts/check-setup.mjswithTimingimport { Pressable } from 'react-native';
import Animated, { useSharedValue, useAnimatedStyle, withTiming } from 'react-native-reanimated';
export function FadeInBox() {
const opacity = useSharedValue(0);
const style = useAnimatedStyle(() => ({ opacity: opacity.value }));
return (
<Pressable onPress={() => (opacity.value = withTiming(opacity.value ? 0 : 1, { duration: 200 }))}>
<Animated.View style={[{ width: 80, height: 80 }, style]} />
</Pressable>
);
}import Animated, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
import { GestureDetector, usePanGesture } from 'react-native-gesture-handler';
export function Draggable() {
const x = useSharedValue(0);
const y = useSharedValue(0);
const pan = usePanGesture({
onUpdate: (e) => {
x.value = e.translationX;
y.value = e.translationY;
},
onDeactivate: () => {
x.value = withSpring(0);
y.value = withSpring(0);
},
});
const style = useAnimatedStyle(() => ({ transform: [{ translateX: x.value }, { translateY: y.value }] }));
return (
<GestureDetector gesture={pan}>
<Animated.View style={[{ width: 100, height: 100 }, style]} />
</GestureDetector>
);
}import Animated from 'react-native-reanimated';
export function ExpandingCard({ expanded }: { expanded: boolean }) {
return (
<Animated.View
style={{
width: expanded ? 260 : 180,
transitionProperty: 'width',
transitionDuration: 220,
}}
/>
);
}scheduleOnRNuseSharedValueuseAnimatedStylewithTimingwithSpringscheduleOnRNusePanGestureuseTapGesturetransitionPropertytransitionDurationtransitionProperty: 'all'flexDirectionbabel-preset-expoexpo installreact-native-worklets/pluginGestureHandlerRootViewscheduleOnRN(fn, ...args)fntransitionProperty: 'all'scheduleOnUIscheduleOnRNgrep -Rni "scheduleOnRN" {baseDir}/references
grep -Rni "transitionProperty" {baseDir}/references
grep -Rni "usePanGesture" {baseDir}/references