DEPRECATION NOTICE: This entire page documents the legacy Inputs system.
For new projects: Use Data Binding instead.
For existing projects: Plan to migrate from Inputs to Data Binding as soon
as possible. This content is provided for legacy support only.
For more information on creating Inputs in Rive, please refer to: Inputs.
Once the Rive file is loaded and instantiated, the state machine can be queried for inputs, and these input values can be set, and in the case of triggers, fired, all programmatically.
Inputs can also be set on components at runtime, see Nested
Inputs below.
Inputs are retrieved from a StateMachine instance.
Access the state machine directly from the RiveWidgetController:
final riveController = RiveWidgetController(riveFile);
final stateMachine = riveController.stateMachine;
final myTrigger = stateMachine.trigger('myTrigger');
final myBool = stateMachine.boolean('myBool');
final myNumber = stateMachine.number('myNumber');
Interact with the inputs:
myTrigger.fire(); // Trigger input
myBool.value = true; // Set boolean input
myNumber.value = 42.0; // Set number input
When you’re done with the inputs, dispose them:
myTrigger.dispose();
myBool.dispose();
myNumber.dispose();
The State Machine is owned by the controller. When you dispose the controller, the state machine will also be disposed.
⚠️ DEPRECATED FEATURE: Nested Inputs are part of the legacy Inputs system.
Use Data Binding instead for controlling
component properties at runtime.
You can control the inputs of Components at runtime. These inputs are not on the main artboard but on a component. To set a nested input, you need to know the path where the input exists at an artboard level.
Example
- Use the artboard’s unique hierarchy name, not the artboard’s name.
- Do not include the name of the main artboard. In the example above, the path is
Volume Molecule, not Menu/Volume Molecule.
- Ensure the components are marked as exported in the editor to access them at runtime:

You can go as many components deep as needed. For example, the Volume Molecule artboard shown above has two components with the following unique hierarchy names:
Volume Component
FX Component
Once you go more than one component deep the path will be a / separated
string of the unique hierarchy names.
If you load in the Menu artboard at runtime, and want to get/set an input on the FX Component artboard, the path will be Volume Molecule/FX Component
Do not use / in the name for your components, as that will break the search
functionality at runtime.
To set the Volume input for the above example:
// Get the nested input named 'volume' from the state machine
final controller = RiveWidgetController(riveFile);
final stateMachine = controller.stateMachine;
final volumeInput = stateMachine.number('volume', path: 'Volume Molecule/Volume Component')!;
volumeInput.value = 80.0;
All options:
number(name, path: 'path/to/input')
bool(name, path: 'path/to/input')
trigger(name, path: 'path/to/input')