Yes, Webflow allows you to control Lottie animations using Interactions, including playing, reversing, looping, and resetting animations based on other elements like buttons.
1. Add the Lottie Animation
- Drag a Lottie animation element onto the canvas.
- Upload your
.json
Lottie file or use one from Webflow's library. - In the Element Settings panel, set the default playback mode (e.g., On Scroll or On Click — for button control, use Manually).
- Select your button element.
- Go to the Interactions panel (lightning bolt icon).
- Click + next to Mouse Click (Tap) and choose Start an Animation.
- Create a new timed animation and name it (e.g., "Play Lottie").
3. Control the Animation (Play, Reverse, Reset)
- Click + Action, select Lottie, and choose your Lottie animation element.
- Set the desired action:
- Play from 0% to 100% = normal playback
- Play from 100% to 0% = reversed playback
- Set to frame 0% = reset position
- Loop = enable only if you start the animation with looping enabled in the Lottie settings
4. Reverse on Second Click
- In the Mouse Click (Tap) trigger, use the "On 1st Click" and "On 2nd Click" options.
- For 1st click, create an action that plays the Lottie animation forward.
- For 2nd click, create another action that plays it in reverse (100% to 0%).
5. Loop the Lottie Animation
- In the Element Settings panel for the Lottie animation:
- Check Loop if you want it to loop automatically.
- Alternatively, use custom JavaScript if you want conditional looping (e.g., loop only when a button is pressed).
Summary
You can control Lottie animations in Webflow using interactions tied to buttons or other objects, allowing you to play, reverse, reset, and loop the animation. Use the Interactions panel to define exact playback behaviors and toggle actions on first/second clicks.