- New Runtime (Recommended)
- Legacy Runtime
The following are props you can set on the
RiveView component:RiveFile
required
The riv file to display, loaded via
useRiveFile or RiveFileFactory.HybridView
The view reference setter, obtained from
useRive.boolean
default:"true"
Automatically start playing the state machine.
Fit
default:"Contain"
How the Rive graphic should fit within its container.
Alignment
default:"Center"
How the Rive graphic should be aligned within its container.
Ignored when using
Fit.Layout.double
default:"-1"
The scale factor to apply to the Rive graphic when using
Fit.Layout. The default value of -1 uses the device’s DPI.
This property has no effect for any other
Fit type.number | FrameRateRange
Caps how often the view renders. A number caps rendering at that many frames per second. A
FrameRateRange ({ minimum, maximum, preferred? }) maps to CAFrameRateRange on iOS; Android caps at preferred, or maximum if preferred isn’t set.If not set, the view renders at the display’s refresh rate.See Frame rate.
Requires
0.5.0 or later.Semantics
default:"Semantics.Off"
Exposes accessibility semantics authored in the editor to the screen reader. See Semantics.
Requires
0.5.0 or later. iOS only; ignored on Android.String
The name of the artboard to display.If not set, the default artboard will be used, as configured in the Editor.
String
The name of the state machine to play.If not set, the default state machine will be used, as configured in the Editor.
ViewModelInstance | DataBindMode | DataBindByName
default:"DataBindMode.Auto"
The view model instance to bind to the state machine. Can be:
- A
ViewModelInstanceobject (fromuseViewModelInstance) DataBindMode.Auto(default) - automatically binds the default view model instanceDataBindMode.None- no data binding{ byName: string }ornew DataBindByName(name)- bind an instance of the artboard’s default view model by name
((error: RiveError) => void)
Called when the view fails to configure or render, for example because of an invalid artboard or state machine name.If not set, errors are logged with
console.error.See Error Handling.RiveView also accepts standard React Native view props such as style.