Reference version

This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

react-native-reanimated

A library that provides an API that greatly simplifies the process of creating smooth, powerful, and maintainable animations.

Android
iOS
tvOS
Web
Included in Expo Go
Recommended version:
4.5.0

react-native-reanimated provides an API that greatly simplifies the process of creating smooth, powerful, and maintainable animations.

Installation

Terminal
npx expo install react-native-reanimated react-native-worklets

No additional configuration is required. Reanimated Babel plugin is automatically configured in babel-preset-expo when you install the library.

Usage

The following example shows how to use the react-native-reanimated library to create a simple animation.

Using react-native-reanimated
import Animated, { useSharedValue, withTiming, useAnimatedStyle, Easing, } from 'react-native-reanimated'; import { View, Button, StyleSheet } from 'react-native'; export default function AnimatedStyleUpdateExample() { const randomWidth = useSharedValue(10); const config = { duration: 500, easing: Easing.bezier(0.5, 0.01, 0, 1), }; const style = useAnimatedStyle(() => { return { width: withTiming(randomWidth.value, config), }; }); return ( <View style={styles.container}> <Animated.View style={[styles.box, style]} /> <Button title="toggle" onPress={() => { randomWidth.value = Math.random() * 350; }} /> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, alignItems: 'center', justifyContent: 'center', }, box: { width: 100, height: 80, backgroundColor: 'black', margin: 30, }, });

Learn more

Visit official documentation

Get full information on API and its usage.