Skip to content

Commit 504a345

Browse files
authored
docs: prefer term graphic over animation and update roadmap docs (#27)
* chore: prefer term graphic over animation * docs: add deprecated warning * docs: not on dev preview and updated roadmap
1 parent 73100e9 commit 504a345

7 files changed

Lines changed: 84 additions & 37 deletions

File tree

README.md

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Rive React Native 2.0
44

5+
## Development Preview
6+
7+
> **⚠️ Development Preview**: This package is currently in development preview. While it's functional and actively maintained, the API may change in future releases. We recommend testing thoroughly before using in production applications. We're actively gathering feedback to improve the library. Please share your thoughts and report any issues you encounter.
8+
59
## Requirements
610

711
- **React Native**: 0.78 or later (0.79+ recommended for better Android error messages)
@@ -79,7 +83,10 @@ Rive_RiveRuntimeAndroidVersion=10.6.0
7983
Use an inline config plugin in your `app.config.ts`:
8084

8185
```typescript
82-
import { withPodfileProperties, withGradleProperties } from '@expo/config-plugins';
86+
import {
87+
withPodfileProperties,
88+
withGradleProperties,
89+
} from '@expo/config-plugins';
8390

8491
export default {
8592
expo: {
@@ -125,32 +132,51 @@ try {
125132

126133
## Feature Support
127134

128-
The following runtime features are currently supported:
129-
130-
✅ Supported | ⚠️ Partial | 🚧 In Development | ❌ Not Planned
131-
132-
| Feature | Status | Description |
133-
| -------------------------- | ------ | ---------------------------------------------------------------- |
134-
| Artboard selection || Sepecify artboard to render |
135-
| State machine selection || Specify a state machine to play |
136-
| Animation selection || Animation playback not planned, use state machines |
137-
| View autoPlay & play/pause || Control view playback |
138-
| Fit & Alignment || Fit modes supported, alignment coming soon |
139-
| Layout & Responsiveness || Basic responsive layouts supported |
140-
| Data Binding | ⚠️ | Control data binding through runtime code |
141-
| Asset management | 🚧 | Out-of-band assets not yet supported |
142-
| State machine inputs || Get/Set (nested) state machine inputs (legacy, see data binding) |
143-
| Text Runs || Update (nested) text runs (legacy, see data binding) |
144-
| Rive Events || Listen to Rive events |
145-
| Rive Audio || Full Rive audio playback supported |
146-
| `useRive()` hook || Convenient hook to access the Rive View ref after load |
147-
| `useRiveFile()` hook || Convenient hook to load a Rive file |
148-
| `RiveView` error handling || Error handler for failed view operations |
149-
| `source` .riv file loading || Conveniently load .riv files from JS source |
150-
| Renderer options || Single renderer option available (Rive) |
135+
This section provides a comprehensive overview of feature availability in `react-native-rive`, comparing it with the [previous Rive React Native runtime](https://github.com/rive-app/rive-react-native) and outlining the development roadmap.
136+
137+
### Runtime Feature Comparison
138+
139+
**Status Legend:** ✅ Supported | ⚠️ Partial | 🚧 In Development | ❌ Not Planned
140+
141+
The following table compares feature availability with the [previous Rive React Native runtime](https://github.com/rive-app/rive-react-native).
142+
143+
| Feature | Status | Description |
144+
| --------------------------------- | ------ | ---------------------------------------------------------------- |
145+
| Artboard selection || Specify artboard to render |
146+
| State machine selection || Specify a state machine to play |
147+
| View autoPlay & play/pause || Control view playback |
148+
| Fit & Alignment || Fit modes supported, alignment coming soon |
149+
| Layout & Responsiveness || Basic responsive layouts supported |
150+
| Data Binding || Control data binding through runtime code |
151+
| Asset management || Load assets out of band (referenced) |
152+
| State machine inputs (Deprecated) || Get/Set (nested) state machine inputs (legacy, see data binding) |
153+
| Text Runs (Deprecated) || Update (nested) text runs (legacy, see data binding) |
154+
| Rive Events (Deprecated) || Listen to Rive events |
155+
| Rive Audio || Rive audio playback supported |
156+
| `useRive()` hook || Convenient hook to access the Rive View ref after load |
157+
| `useRiveFile()` hook || Convenient hook to load a Rive file |
158+
| `RiveView` error handling || Error handler for failed view operations |
159+
| `source` .riv file loading || Conveniently load .riv files from JS source |
160+
| Animation selection || Animation playback not planned, use state machines |
161+
| Renderer options || Single renderer option available (Rive) |
151162

152163
> **Note**: Several features in the table above (state machine inputs, text runs, and events) represent legacy approaches to runtime control. We recommend using data binding instead, as it provides a more maintainable way to control your Rive graphics (both at edit time and runtime).
153164
165+
### Roadmap
166+
167+
**Status Legend:** ✅ Completed | 🚧 Planned |
168+
169+
This section tracks new features and improvements planned for this runtime that were not available in the [previous Rive React Native runtime](https://github.com/rive-app/rive-react-native).
170+
171+
| Feature | Status |
172+
| ----------------------------------------------------------------------------------------------------- | ------ |
173+
| [Reusable .riv File resources (preloading)](https://github.com/rive-app/rive-react-native/issues/260) ||
174+
| [Data Binding - Images](https://github.com/rive-app/rive-nitro-react-native/issues/9) | 🚧 |
175+
| [Data Binding - Artboards](https://github.com/rive-app/rive-nitro-react-native/issues/10) | 🚧 |
176+
| [Data Binding - Lists](https://github.com/rive-app/rive-nitro-react-native/issues/11) | 🚧 |
177+
| [Data Binding - Value props](https://github.com/rive-app/rive-nitro-react-native/pull/24) | 🚧 |
178+
| [Suspense](https://github.com/rive-app/rive-nitro-react-native/pull/19) | 🚧 |
179+
154180
## Contributing
155181

156182
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

example/src/pages/OutOfBandAssets.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default function StateMachine() {
6363
<RiveView
6464
file={riveFile}
6565
fit={Fit.Contain}
66-
style={styles.animation}
66+
style={styles.rive}
6767
stateMachineName="State Machine 1"
6868
// The `referencedAssets` prop allows you to load external assets from various sources:
6969
// - A URI
@@ -122,7 +122,7 @@ const styles = StyleSheet.create({
122122
alignItems: 'center',
123123
justifyContent: 'flex-start',
124124
},
125-
animation: {
125+
rive: {
126126
width: '100%',
127127
height: 400,
128128
},

example/src/pages/RiveEventsExample.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ import {
1010
} from 'react-native-rive';
1111
import { type Metadata } from '../helpers/metadata';
1212

13+
/**
14+
* @deprecated Rive events at runtime is deprecated. Use data binding instead.
15+
*
16+
* See https://rive.app/docs/runtimes/data-binding
17+
*
18+
* Demonstrates getting and handling Rive events
19+
*/
1320
export default function EventsExample() {
1421
const { riveViewRef, setHybridRef } = useRive();
1522
const { riveFile, isLoading, error } = useRiveFile(

example/src/pages/RiveStateMachineInputsExample.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import { useEffect } from 'react';
33
import { Fit, RiveView, useRive, useRiveFile } from 'react-native-rive';
44
import { type Metadata } from '../helpers/metadata';
55

6+
/**
7+
* @deprecated Setting state machine inputs at runtime is deprecated. Use data binding instead.
8+
*
9+
* See https://rive.app/docs/runtimes/data-binding
10+
*
11+
* Demonstrates getting and setting state machine inputs programmatically
12+
*/
613
export default function StateMachineInputsExample() {
714
const { riveViewRef, setHybridRef } = useRive();
815
const { riveFile, isLoading, error } = useRiveFile(

example/src/pages/RiveTextRunExample.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import { useEffect } from 'react';
33
import { Fit, RiveView, useRive, useRiveFile } from 'react-native-rive';
44
import { type Metadata } from '../helpers/metadata';
55

6+
/**
7+
* @deprecated Setting text run values is deprecated. Use data binding instead.
8+
*
9+
* See https://rive.app/docs/runtimes/data-binding
10+
*
11+
* Demonstrates getting and setting text run values in Rive graphics
12+
*/
613
export default function TextRunExample() {
714
const { riveViewRef, setHybridRef } = useRive();
815
const { riveFile, isLoading, error } = useRiveFile(
@@ -83,5 +90,5 @@ const styles = StyleSheet.create({
8390
TextRunExample.metadata = {
8491
name: 'Text Run',
8592
description:
86-
'Demonstrates getting and setting text run values in Rive animations',
93+
'Demonstrates getting and setting text run values in Rive graphics',
8794
} satisfies Metadata;

src/core/RiveFile.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ const RiveFileInternal =
1414

1515
/**
1616
* Factory namespace for creating RiveFile instances from different sources.
17-
* Provides static methods to load Rive animations from URLs, resources, or raw bytes.
17+
* Provides static methods to load Rive files from URLs, resources, or raw bytes.
1818
*/
1919
export namespace RiveFileFactory {
2020
/**
2121
* Creates a RiveFile instance from a URL.
22-
* @param url - The URL of the Rive animation file
22+
* @param url - The URL of the Rive (.riv) file
2323
* @param loadCdn - Whether to load from CDN (default: true)
2424
* @returns Promise that resolves to a RiveFile instance
2525
*/
@@ -37,7 +37,7 @@ export namespace RiveFileFactory {
3737

3838
/**
3939
* Creates a RiveFile instance from a local file path URL.
40-
* @param pathURL - The local file path of the Rive animation file
40+
* @param pathURL - The local file path of the Rive (.riv) file
4141
* @param loadCdn - Whether to load from CDN (default: true)
4242
* @returns Promise that resolves to a RiveFile instance
4343
*/
@@ -73,7 +73,7 @@ export namespace RiveFileFactory {
7373

7474
/**
7575
* Creates a RiveFile instance from raw bytes.
76-
* @param bytes - The raw bytes of the Rive animation file
76+
* @param bytes - The raw bytes of the Rive (.riv) file
7777
* @param loadCdn - Whether to load from CDN (default: true)
7878
* @returns Promise that resolves to a RiveFile instance
7979
*/
@@ -97,13 +97,13 @@ export namespace RiveFileFactory {
9797
* @throws Error if the source is invalid or cannot be resolved
9898
* @example
9999
* // Using a resource ID
100-
* const riveFile1 = await RiveFileFactory.fromSource(require('./animation.riv'));
100+
* const riveFile1 = await RiveFileFactory.fromSource(require('./your_file.riv'));
101101
*
102102
* // Using a URI object
103-
* const riveFile2 = await RiveFileFactory.fromSource({ uri: 'https://example.com/animation.riv' });
103+
* const riveFile2 = await RiveFileFactory.fromSource({ uri: 'https://example.com/your_file.riv' });
104104
*
105105
* // Using a local file URI
106-
* const riveFile3 = await RiveFileFactory.fromSource({ uri: 'file:///path/to/animation.riv' });
106+
* const riveFile3 = await RiveFileFactory.fromSource({ uri: 'file:///path/to/your_file.riv' });
107107
*
108108
* @note To use .riv files with require(), you need to add 'riv' to the asset extensions in your metro.config.js:
109109
* ```js

src/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function multiply(a: number, b: number): number {
2828
}
2929

3030
/**
31-
* RiveView is a React Native component that renders Rive animations.
31+
* RiveView is a React Native component that renders Rive graphics.
3232
* It provides a seamless way to display and control Rive graphics in your app.
3333
*
3434
* @example
@@ -53,8 +53,8 @@ export function multiply(a: number, b: number): number {
5353
* @property {Object} [style] - React Native style object for container customization
5454
*
5555
* The component also exposes methods for controlling playback:
56-
* - play(): Starts playing the animation
57-
* - pause(): Pauses the animation
56+
* - play(): Starts playing the Rive graphic
57+
* - pause(): Pauses the Rive graphic
5858
*/
5959
export const RiveView = getHostComponent<RiveViewProps, RiveViewMethods>(
6060
'RiveView',

0 commit comments

Comments
 (0)