Component API Reference
This page provides a detailed reference for the main <Rive /> component.
<Rive />
A declarative React component for displaying a Rive animation.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
src |
string |
- | Required. The URL or public path to the .riv file. |
artboard |
string |
undefined |
The name of the artboard to render. Defaults to the first one in the file. |
animations |
string \| string[] |
undefined |
The name(s) of animations to play on load. |
stateMachines |
string \| string[] |
undefined |
The name(s) of state machines to play on load. |
layout |
Layout |
undefined |
A Rive Layout object to configure fit and alignment. See Layout Guide. |
useOffscreenRenderer |
boolean |
true |
(WebGL only) If true, uses a single shared WebGL context for multiple Rive instances to improve performance. |
shouldDisableRiveListeners |
boolean |
false |
If true, prevents Rive from adding event listeners (e.g., for pointer events) to the canvas. |
shouldResizeCanvasToContainer |
boolean |
true |
If true, the canvas will automatically resize to fit its parent container. |
automaticallyHandleEvents |
boolean |
false |
If true, allows the runtime to automatically handle certain Rive events, like OpenUrlEvent. See Events Guide. |
children |
React.ReactNode |
undefined |
Child elements to render inside the <canvas> for accessibility or fallback content. |
In addition to these, all standard HTML <canvas> attributes (e.g., className, style, aria-label) are passed directly to the canvas element.