> ## Documentation Index
> Fetch the complete documentation index at: https://rive.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Inputs

> ⚠️ DEPRECATED: Use Data Binding instead of Inputs for controlling Rive animations

<Warning>
  **DEPRECATION NOTICE:** This entire page documents the legacy Inputs system.
  **For new projects:** Use <Link href="data-binding">Data Binding</Link> instead.
  **For existing projects:** Plan to migrate from Inputs to Data Binding as soon
  as possible. **This content is provided for legacy support only.**
</Warning>

For more information on creating Inputs in Rive, please refer to: [Inputs](/editor/state-machine/inputs).

## Controlling state machine 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.

<Note>
  Inputs can also be set on components at runtime, see [Nested
  Inputs](#nested-inputs) below.
</Note>

### Inputs

Just like other methods within the `rive-android` runtime, use the view to set values on a state machine input. In this case, there is no need to grab references to state machine input instances to set values.

There are 3 different methods to set input values or trigger inputs for number, boolean, and trigger inputs respectively:

* `.setNumberState(stateMachineName: String, inputName: String, value: Float)`
* `.setBooleanState(stateMachineName: String, inputName: String, value: Boolean)`
* `.fireState(stateMachineName: String, inputName: String)`

```kotlin theme={null}
// i.e Set input state on a number input
animationView.setNumberState("Designer's Test", "Level", 0f)

// i.e Set boolean state on a boolean input
animationView.setBooleanState("Boolean test", "foo", true)

// i.e Fire a trigger input
animationView.fireState("Trigger test", "fireInput");
```

## Nested Inputs

<Warning>
  **⚠️ DEPRECATED FEATURE:** Nested Inputs are part of the legacy Inputs system.
  **Use <Link href="data-binding">Data Binding</Link> instead** for controlling
  component properties at runtime.
</Warning>

You can control the inputs of [Components](editor/fundamentals/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

![Image](https://ucarecdn.com/2b241b74-91d1-4a7b-b18f-32c3ff94762d/)

<Warning>
  * 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](/editor/exporting/exporting-names) in the editor to access them at runtime:

  ![Image](https://ucarecdn.com/2280e7c9-2e91-4cf6-89c6-b122e1b2b5e7/)
</Warning>

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`

<Note>
  Once you go more than one component deep the path will be a `/` separated
  string of the unique hierarchy names.
</Note>

![Image](https://ucarecdn.com/8ba625a6-7f9a-46fe-afaf-8e3bc562dc45/)

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`

<Warning>
  Do not use `/` in the name for your components, as that will break the search
  functionality at runtime.
</Warning>

To set the **Volume** input for the above example:

```kotlin theme={null}
// `animationView` is RiveAnimationView
animationView.setNumberStateAtPath("volume", 80.0, "Volume Molecule/Volume Component")
```

**All options on `RiveAnimationView`:**

* `setNumberStateAtPath(inputName: String, value: Float, path: String)`
* `setBooleanStateAtPath(inputName: String, value: Boolean, path: String)`
* `fireStateAtPath(inputName: String, path: String)`

**All options on `RiveFileController`:**

* `setNumberStateAtPath(inputName: String, value: Float, path: String)`
* `setBooleanStateAtPath(inputName: String, value: Boolean, path: String)`
* `fireStateAtPath(inputName: String, path: String)`
