# use_animation

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-view/prelude/animation/function-use_animation/

**function** · [`ferroui-view`](/docs/0.5.0/api/ferroui-view/) · v0.5.0

```rust
fn use_animation<C, D>(target: crate::control_flow::NodeRef<C>, trigger: D, animation: impl FnOnce() -> AnimationBuilder + 'static)
where C: ObjectType + Upcast<ferroui_base::animation::Animatable>,
      D: PartialEq + 'static
```

Runs `animation` on the control of `target` once the controls of the run
are in place, and again whenever `trigger` differs from the last run's;
a run still in progress is cancelled first, and when the component is
taken out.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/animation.rs#L166)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
