Mila A
Mila A

Reputation: 579

React Framer Motion how to stop and play animation

Please help me making out how can I stop and play framer motion animation. Or any other lib like GSAP or Lottie which can be used with ReactJS. The thing is that I need to add animated elements over a video. And the video can be stopped/played like any other video. And the animations also need to be stopped/played. I can't use FFmpeg as I only need to mock these, not produce an actual animated video. Thanks!

Upvotes: 4

Views: 16252

Answers (1)

Cadin
Cadin

Reputation: 4649

In Framer Motion you can use Animation Controls to stop and start animations.

From the docs:

The useAnimation hook can be used to create a set of imperative AnimationControls with a start and stop method. These controls can be passed to one or more motion components via the animate prop.

Upvotes: 7

Related Questions