react-native-reanimated
React Native Reanimated provides a more comprehensive, low level abstraction for the Animated library API to be built on top of and hence allow for much greater flexibility especially when it comes to gesture based interactions.
With Reanimated, you can easily create smooth animations and interactions that run on the UI thread.
Documentation
For more information about this library and its API, see https://docs.swmansion.com/react-native-reanimated/ in the official Software Mansion documentation.
Installation
- Add the JavaScript library dependency in the package.json file:
    "dependencies": { ... "@amazon-devices/react-native-reanimated": "~2.0.0" }
- Add @amazon-devices/react-native-reanimatedplugin to your babel.config.js:module.exports = { plugins: [ ... '@amazon-devices/react-native-reanimated/plugin', ], };
- To clear the Metro bundler cache run the following command:
    npm start --reset-cache
- Reinstall the package-lock.json file by running the npm installcommand.
For additional information and context, see installation in the Software Mansion documentation.
Examples
The following example shows how to run a simple animation in an infinite loop using the withTiming method.
import React from 'react';
import { StyleSheet, View } from 'react-native';
import Animated, {
  useSharedValue,
  useAnimatedStyle,
  withTiming,
  withRepeat,
} from '@amazon-devices/react-native-reanimated';
export default function App() {
  const offset = useSharedValue(200);
  const animatedStyles = useAnimatedStyle(() => ({
    transform: [{ translateX: offset.value }],
  }));
  React.useEffect(() => {
    offset.value = withRepeat(
      withTiming(-offset.value, { duration: 1500 }),
      -1,
      true
    );
  }, []);
  return (
    <View style={styles.container}>
      <Animated.View style={[styles.box, animatedStyles]} />
    </View>
  );
}
const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    height: '100%',
  },
  box: {
    height: 120,
    width: 120,
    backgroundColor: '#b58df1',
    borderRadius: 20,
  },
});
The following example shows how run a spring-based animation using the withSpring function:
import React from 'react';
import { StyleSheet, View } from 'react-native';
import Animated, {
  useSharedValue,
  useAnimatedStyle,
  withSpring,
  withRepeat,
} from '@amazon-devices/react-native-reanimated';
const initialOffset = 200;
export default function App() {
  const offset = useSharedValue(initialOffset);
  const animatedStyles = useAnimatedStyle(() => ({
    transform: [{ translateX: offset.value }],
  }));
  React.useEffect(() => {
    offset.value = withRepeat(withSpring(-offset.value), -1, true);
  }, []);
  return (
    <View style={styles.container}>
      <Animated.View style={[styles.box, animatedStyles]} />
    </View>
  );
}
const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    height: '100%',
  },
  box: {
    height: 120,
    width: 120,
    backgroundColor: '#b58df1',
    borderRadius: 20,
  },
});
API support
The reanimated library on Vega provides a Turbo Module which adds a support for most of methods listed below.
Animations
| method | description | 
|---|---|
| withTiming | withTiminglets you create an animation based on duration and easing. | 
| withSpring | withSpringlets you create spring-based animations. | 
| withDecay | withDecaylets you create animations that mimic objects in motion with friction. The animation will start with the provided velocity and slow down over time according to the given deceleration rate until it stops. | 
| withSequence | withSequenceis an animation modifier that lets you run animations in a sequence. | 
| withRepeat | withRepeatis an animation modifier that lets you repeat an animation given number of times or run it indefinitely. | 
| withDelay | withDelayis an animation modifier that lets you start an animation with a delay. | 
Core
| method | description | 
|---|---|
| useSharedValue | useSharedValuelets you define shared values in your components. | 
| useAnimatedStyle | useAnimatedStylelets you create a styles object, similar toStyleSheetstyles, which can be animated. | 
| useAnimatedProps | useAnimatedPropslets you create an animated props object which can be animated using shared values. | 
| useAnimatedRef | useAnimatedReflets you get a reference of a view. Used alongside measure, scrollTo, and useScrollViewOffset functions. | 
| useDerivedValue | useDerivedValuelets you create new shared values based on existing ones while keeping them reactive. | 
| createAnimatedComponent | createAnimatedComponentlets you create an Animated version of any React Native component. Wrapping a component withcreateAnimatedComponentallows Reanimated to animate any prop or style associated with that component. | 
| cancelAnimation | cancelAnimationlets you cancel a running animation paired to a shared value. | 
Scroll
| method | description | 
|---|---|
| scrollTo | scrollToprovides synchronous scroll on the UI thread to a given offset using an animated ref to a scroll view. This allows performing smooth scrolling without lags. | 
| useScrollViewOffset | useScrollViewOffsetallows you to create animations based on the offset of aScrollView. The hook automatically detects if theScrollViewis horizontal or vertical. | 
| useAnimatedScrollHandler | useAnimatedScrollHandleris a convenience hook that returns an event handler reference which can be used with React Native's scrollable components. | 
Device
| method | description | 
|---|---|
| useAnimatedKeyboard | useAnimatedKeyboardallows creating animations based on current keyboard position. | 
| useAnimatedSensor | useAnimatedSensorlets you create animations based on data from the device's sensors: accelerometer, gyroscope, graviry, magnetic field and rotation. | 
| useReducedMotion | useReducedMotionlets you query the reduced motion system setting. | 
Threading
| method | description | 
|---|---|
| runOnJS | runOnJSrunOnJS lets you asynchronously run non-workletized* functions that couldn't otherwise run on the UI thread. | 
| runOnUI | runOnUIlets you asynchronously run workletized functions on the UI thread. | 
| createWorkletRuntime | createWorkletRuntimelets you create a new JS runtime which can be used to run worklets possibly on different threads than JS or UI thread. | 
- workletize
- To convert a JavaScript function into a serializable object which can be copied and ran over on UI thread. Functions marked with "worklet"; directive are automatically picked up and workletized by the Reanimated Babel plugin.
Utilities
| method | description | 
|---|---|
| interpolate | interpolatelets you map a value from one range to another using linear interpolation. | 
| clamp | clamplets you limit a value within a specified range. | 
| interpolateColor | interpolateColormaps input range to output colors using linear interpolation. | 
| getRelativeCoords | getRelativeCoordsdetermines the location on the screen, relative to the given view. | 
Advanced APIs
| method | description | 
|---|---|
| measure | measurelets you synchronously get the dimensions and position of a view on the screen, all on the UI thread. | 
| useAnimatedReaction | useAnimatedReactionallows you to respond to changes in a shared value. | 
| useFrameCallback | useFrameCallbacklets you run a function on every frame update. | 
| useEvent | useEventis low-level hook returning event handler that will be invoked with native events, which should be used in order to create custom event handler hook likeuseAnimatedGestureHandleroruseAnimatedScrollHandler. | 
| useHandler | useHandleris low-level hook returning context object and value indicating whether worklet should be rebuilt, which should be used in order to create custom event handler hook likeuseAnimatedGestureHandleroruseAnimatedScrollHandler. | 
| dispatchCommand | dispatchCommandallows to dispatch command on a native component synchronously from the UI thread. | 
| setNativeProps | setNativePropslets you imperatively update component properties. | 
The reanimated library on Vega has a few exceptions in terms of API support. This section explains those exceptions.
- useAnimatedSensoris not supported on Vega platform. On FireTV, sensors are not supported so far.
- useReducedMotionis not supported on Vega platform. For Vega, a setting for enabling/disabling reduced motion is not available so far.
- Layout Animationsare not implemented on- Fabricyet, so they are not supported on Vega platform.
- SETs (Shared Element Transitions)allows you to smoothly transform a component from one screen into a component on another screen. It's experimental feature, which hasn't had a support on Vega yet.
Known Issues on Vega
- Animations that use withRepeatstop repeating after fast refresh is used.
- Style does not update on the animation after fast refresh is used.
Supported versions
| Package name | Amazon NPM library version | OSS NPM library version | Vega OS build number | Vega SDK version | Release notes | 
|---|---|---|---|---|---|
| @amazon-devices/react-native-reanimated | 2.0.0+3.5.4 | 3.5.4 | OS 1.1 (201010435950) | 0.19 | Released as a system distributed library. Backward-compatibility checks are not required on the initial release. | 
Additional Resources
For information on additional libraries, see Supported Third-Party Libraries and Services.
Credits
This project has been built and is maintained thanks to the support from Shopify, Expo.io, and Software Mansion.
Last updated: Oct 13, 2025

