🚀 The new Rive React Native runtime is now available! Built with Nitro for improved performance and better React Native integration.Get started:Migration Timeline:
- Short term: Complete the new runtime, see Feature Support and Roadmap
- Medium term: Address major concerns in the legacy package while supporting migration
- Long term: Full migration to the new package
Overview
This guide documents how to get started using the Rive React Native runtime. The source for the new runtime is available in its GitHub repository.- New Runtime (Recommended)
- Legacy Runtime
Requirements
- React Native: 0.78 or later (0.79+ recommended for improved Android error messages)
- Expo SDK: 53 or later (for Expo users)
- iOS: 15.1 or later
- Android: SDK 24 (Android 7.0) or later
- Xcode: 16.4 or later
- JDK: 17 or later
- Nitro Modules: 0.25.2 or later
Quick Start
Follow these quick start steps to get familiar with the Rive React Native runtime.Rive File
Remix/download the Rive file used in this quick start guide
Complete example
View the complete quick start example
1
Install the dependency
react-native-nitro-modules is required as this library relies on Nitro Modules.2
Setup
Import the necessary components and define styles for the following steps.
Imports
Styles
3
Rive File and Component
The Further reading:
RiveView component displays Rive graphics. It requires a single prop: file, a RiveFile object.Use the useRiveFile hook to load a riv file and create a RiveFile object. This object can be cached and reused across multiple components.Loading a file
4
Layout
Configure how the graphic fits within its container.For this example, we’ll set Further reading:
fit to Layout, which automatically resizes the artboard to match the view size. This is ideal for responsive Rive graphics built with Layouts.Layout
5
View Reference
Use the Further reading:
useRive() hook to access the Rive view reference for programmatic control.useRive hook
6
Data binding
Create the view model instance manually using the Use the view model property hooks to update and listen to property changes.Further reading:
useViewModelInstance hook and pass it to the view.This approach lets you set initial property values in the onInit callback before the view loads and decouples the ViewModelInstance from the RiveView.Manually create view model instance
Property hooks
See our example app for more usage examples.
Key Components
RiveView
The component to render Rive content:useRiveFile
Hook for loading Rive files from a URL or local source:useRive
Hook to access the Rive view reference for programmatic control:useViewModelInstance
Hook to create a view model instance from a RiveFile, ViewModel, or RiveViewRef:dataBind prop in RiveView.RiveViewRef: