Reanimated comes with declarative API for creating animations. Complexity reduced from tens of methods to just a few. Define what the animation should look like and leave Reanimated to animate the styles and properties for you.
Reanimated lets you define animations in plain JavaScript which run natively on the UI thread by default. Smooth animations and interactions up to 120 fps and beyond. Reanimated delivers a native experience your users deserve.
Reanimated’s power doesn’t end on animating only simple views or images. Hook your animations into device sensors or keyboard. Create amazing experiences using Layout Animations or animate elements between navigation screens with ease.
Animate every React Native prop on iOS, Android and the Web up to 120 fps.
function App() {
const width = useSharedValue(100);
const handlePress = () => {
width.value = withSpring(width.value + 50);
};
return <Animated.View style={{ ...styles.box, width }} />
}
Gesture smoothly thanks to Reanimated’s integration with React Native Gesture Handler.
import { Gesture, GestureDetector } from ?"react-native-gesture-handler";
function App() {
const pan = Gesture.Pan();
return (
<GestureDetector gesture={pan}>
<Animated.View />
</GestureDetector>
);
}
Animate views when they are added and removed from the view hierarchy. Just like that.
function App() {
return <Animated.View entering={FadeIn} exiting={FadeOut} />;
}
Connect your animations to a gyroscope or accelerometer with just one hook. It’s that easy.
const gyroscope = useAnimatedSensor(SensorType.GYROSCOPE);
useDerivedValue(() => {
const { x, y, z } = gyroscope.sensor.value;
});
Create animations based on the device keyboard state and position.
function App() {
const keyboard = useAnimatedKeyboard();
const animatedStyle = useAnimatedStyle(() => ({
transform: [{ translateY: -keyboard.height.value }],
});
//...
}
Seamlessly animate elements between navigation screens with a single line of code.
function App() {
return <Animated.View sharedTransitionTag="hero-element" />
}
“Reanimated is an amazing library! It made my apps smooth and engaging, boosting performance and user happiness. Highly recommend for any developer wanting to upgrade their app.”
“Simply - it’s pure joy to write animations with Reanimated now! Also, API that was introduced in V2 - imo game changer in terms of the learning curve (compared to API from V1) 💜.”