- 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.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 }- bind by instance name
((error: RiveError) => void)
required
Custom error handling callback.