Add animation to Webflow

Start with Lottie JSON. It is the format Mosso picks for the Webflow or Framer destination, and it gives Webflow a file it can control through its Lottie element.

Export for Webflow

  1. Open an example below and edit it in Mosso.

  2. Click Export. Under Where it goes, choose Webflow or Framer (no code).

  3. Export the .json file. Keep the project if you want to change the animation later.

Add the Lottie element

  1. In Webflow, upload the JSON file through the Assets panel.

  2. Open Add, then Media. Drag a Lottie animation element onto the page.

  3. Choose Replace Lottie sequence and select the uploaded file.

  4. Set the element width and height to match your animation proportions. Turn on Loop if the piece should repeat.

  5. Publish the page and check it on a phone as well as a computer.

Webflow also accepts dotLottie files. Use JSON for this workflow so your file matches the Mosso destination and the steps shown after export. Webflow explains both formats in its Lottie element guide.

Check playback and layout

If the animation plays once before anyone sees it, use a Webflow interaction to start it when it enters view. Avoid combining an interaction with another playback setting that controls the same animation.

For a blank element, first check the file in the Lottie viewer. If it works there, replace the uploaded sequence and check the element dimensions. A wide animation squeezed into a square will leave empty space.

For visitors who prefer reduced motion, show a still image instead of an autoplaying loop. Keep the message in normal page text so it remains readable even when the animation is stopped.

Code embed with a still frame

Every library page has a Webflow tab under Use it in code. It is a Code Embed that plays the file with the dotLottie web component and shows a still frame to people who ask for less motion, which the Lottie element does not do. This is the code for the Loading spinner Lottie animation:

  1. No code: drag a Lottie animation element from Add, Media and upload spinner.json.

  2. To show a still frame to people who ask for less motion, upload the file in Assets, copy its link, then paste this into a Code Embed element with that link.

Code Embed
<!-- Put the link Webflow gives spinner.json in src. -->
<script type="module" src="https://cdn.jsdelivr.net/npm/@lottiefiles/dotlottie-wc@0.10.0/dist/dotlottie-wc.js"></script>

<div role="status" aria-label="Loading">
  <dotlottie-wc src="https://your-asset-link/spinner.json" autoplay loop data-still="0.242"
    style="display: block; width: 64px; height: 64px"></dotlottie-wc>
</div>

<script>
  // People who ask for less motion see a still frame: data-still is how far in, from 0 to 1.
  if (matchMedia('(prefers-reduced-motion: reduce)').matches) {
    const players = document.querySelectorAll('dotlottie-wc');
    players.forEach((el) => el.removeAttribute('autoplay'));
    customElements.whenDefined('dotlottie-wc').then(() => players.forEach((el) => {
      const player = el.dotLottie;
      if (!player || !el.dataset.still) return;
      const show = () => player.setFrame(Math.round(Number(el.dataset.still) * (player.totalFrames - 1)));
      if (player.isLoaded) show();
      else player.addEventListener('load', show);
    }));
  }
</script>

Use the asset link

Upload the JSON file in the Assets panel and copy its link. Put the whole link in src, in place of https://your-asset-link/spinner.json. Webflow serves assets from cdn.prod.website-files.com with a header that lets any page load them, so the player can fetch the file from there.

Nothing shows while you design

Scripts in a Code Embed run on the published page. Publish, then check the live page.

It has no size

The code gives the player a width and a height (or a width and an aspect ratio). If the Code Embed sits in a flex or grid parent that squeezes it, give the Code Embed a width as well.

Free downloads and editable examples

The editor and every export format are free, with no card and no Mosso watermark. Library downloads need a free account. You can download up to 50 library animations a day, with the limit resetting at midnight UTC. Each download contains one animation.

Open an example below to try its look. Use its download buttons to get Lottie JSON or dotLottie through your account, or choose Edit this in Mosso to change the layers and export another format. A preview file is for playback, not an account download link.

Create a free account or sign in to download from the library. Read the library licence before sharing the finished work.

See the full export guide

Try these animations

Open an example to try its colours and timing, or edit it in Mosso.

Browse the animation library