# How do I know when a Lottie animation has completed?

> Listen for the player's complete event. In lottie-web use anim.addEventListener('complete', fn); in lottie-react use the onComplete prop; on Android add an Animator listener and use onAnimationEnd; on iOS pass a completion closure to play(). Looping animations never complete, so listen for the loop event instead.

Updated November 2026. Source: https://www.exodeui.com/questions/how-to-know-when-lottie-animation-completes/

## Key takeaways

- lottie-web: "complete" fires when a non-looping animation ends
- Looping animations fire "loopComplete" on each loop instead
- lottie-react: onComplete and onLoopComplete props
- Android: addAnimatorListener, onAnimationEnd
- iOS: animationView.play { finished in ... }

## Frequently asked questions

### Why does my Lottie complete event never fire?

The animation is probably set to loop. Set loop to false, or listen for loopComplete instead.

### Does complete fire when I call stop()?

No. complete fires when playback reaches the end on its own. Run your own logic where you call stop().

### How do I run code at a specific frame?

In lottie-web, listen for enterFrame and check anim.currentFrame, or split the animation into segments with playSegments.

### Is there a completion callback in Lottie for Flutter?

Yes. With the lottie package you pass your own AnimationController and listen for AnimationStatus.completed.

## Related

- [How to loop or pause a Lottie animation](https://www.exodeui.com/questions/how-to-loop-or-pause-lottie-animation)
- [How to use Lottie in React](https://www.exodeui.com/questions/how-to-use-lottie-in-react)
- [Lottie vs state machine runtimes](https://www.exodeui.com/learn/lottie-vs-state-machine-runtimes)
- [State machines for UI](https://www.exodeui.com/learn/state-machine-ui)
