How Do I Add a Lottie in Webflow?

If you’re looking to add some interactive animations to your Webflow project, Lottie is a fantastic option. Lottie is a library created by Airbnb that allows you to easily add beautiful animations created with Adobe After Effects to your website. In this tutorial, we’ll walk through the steps of adding a Lottie animation in Webflow.

Step 1: Prepare Your Animation

Before we jump into Webflow, make sure you have your Lottie animation file ready. This file should be exported from Adobe After Effects as a JSON file. If you don’t have an animation yet, you can find pre-made ones on the LottieFiles website.

Step 2: Create a New Project in Webflow

If you haven’t done so already, log in to your Webflow account and create a new project. Once your project is set up, navigate to the page where you want to add the Lottie animation.

Step 3: Add an Embed Element

To add the Lottie animation to your page, we’ll use an Embed element in Webflow. Find the section or container where you want the animation to appear and drag an Embed element into it.

Note: If you’re working with a CMS collection list or dynamic content, make sure the Embed element is placed inside the appropriate dynamic item or collection list wrapper.

Step 4: Get Your Lottie Animation Code

Next, go back to your LottieFiles account or wherever you have your animation file stored. Locate the JSON code for your animation and copy it.

Step 5: Paste Your Animation Code in Webflow

Go back to Webflow and select the Embed element you added earlier. In the settings panel on the right side of the Webflow interface, paste your Lottie animation code into the “Embed Code” field.

Note: If your animation is hosted on a different server, make sure to update the URL in the code accordingly.

Step 6: Adjust Size and Position

By default, the Lottie animation may not fit perfectly within your container. To adjust its size and position, you can use CSS properties such as width, height, and margin. You can either use inline styles directly in the Embed element or add custom classes to style it.

Step 7: Publish Your Webflow Project

Once you’re satisfied with the placement of your Lottie animation, save your changes and publish your Webflow project. Now you can view your website live and see the Lottie animation in action.

Troubleshooting Tips:

  • If your animation doesn’t appear: Double-check that you have copied and pasted the correct JSON code for your Lottie animation in Webflow. Also, ensure that any external URLs are correct.
  • If your animation isn’t displaying correctly: Verify that you have adjusted the size and position of the Embed element properly. Use browser developer tools to inspect and debug any CSS issues that may be affecting its display.

Congratulations! You’ve successfully added a Lottie animation to your Webflow project. Now you can take advantage of this powerful library to create engaging and interactive experiences for your website visitors.