Skip to main content

Lottie Animations

Added in Salient v15
Live preview of the Lottie Animations element in the Salient WordPress theme. A Lottie animation of shapes drawing themselves in, played once as it comes into view. Sample content, for demonstration only.

A Lottie animation is a vector animation saved as a small JSON file, usually exported from After Effects or downloaded from a library such as LottieFiles. It plays in the browser at any size without losing sharpness, and it weighs a fraction of a video or GIF of the same motion.

Lightweight, scalable animations​

Salient's Lottie Animation element adds one of these files to a WordPress page and controls its playback from the page builder: when it starts, whether it loops, how fast it runs and which frames it plays. No code is involved.

Using an external source​

The simplest method of adding Lottie animations to your site is to grab an existing animation and paste in the file URL into the Salient Lottie element.

1. Locate a Lottie file​

There are many collections of Lottie files you can find online, but for this tutorial, we’ll be using lottiefiles.

Lottie files offers thousands of free animations you can browse. Once you’ve located an animation, copy the URL from the “Lottie Animation URL” field as shown on the right.

A LottieFiles animation page for Growth Graph, with the Lottie Animation URL field outlined in red below the preview

2. Add the file through Salient​

In the page builder, add a Lottie element in your desired location and paste the URL into the field.

If the URL is to a valid Lottie file, you’ll immediately see a preview of the animation within the page builder element.

Note: If you opt to use a site other than lottiefiles, ensure that you trust the source before adding any Lottie file to your site.

The Lottie Animation Settings panel in the page builder, the pasted JSON URL outlined in red beneath a live preview

3. Configure Animation Properties​

Trigger Type Choice​

Determines what action will cause the Lottie animation to play. The available options are:

  1. Autoplay: automatically starts playing the Lottie animation as soon as the file loads
  2. Play when visible: Similar to Autoplay, but starts the animation only when the user has scrolled down to where it’s in view
  3. Scroll Position Seek: Scrubs through the animation from start to finish depending on the user’s scroll position.
  4. Hover: Triggers the animation to play only when the user has hovered over it.

Autoplay

Scroll position seek

Hover

Loop Animation Toggle​

Determines whether the animation should start from the beginning and play infinite after each last frame. This is only available as an option when using the “Autoplay” and “Play when visible” trigger types.

Animation Start/End Frames Number​

Allows you to limit the section of the animation that will play.

Animation Speed Number​

Determines how fast your Lottie animation will play.

Dimensions NumberResponsive. Set a different value for desktop, tablet and phone.​

Allows you to define a custom width and height uniquely on each device viewport that you would like the Lottie animation display at. If this is left blank, the animation will attempt to fill the column width.

Preserve Aspect Ratio Choice​

When this is enabled, your Lottie animation will not stretch its original aspect ratio. However, sometimes it might be useful to allow your animation to stretch to fill an area and setting this field to “none” will make that easier.

Creating your own Lottie Animation​

While we’re not going to cover a full example of the process, it is possible to create your own Lottie animations using Adobe After Effects. All you need to be able to export Lottie animations from After Effects is a free plugin. Below are two plugins that add the functionality.

The white LottieFiles logo, a rounded square icon with a curved stroke beside the LottieFiles name

The Bodymovin logo, a chunky purple letter B with a yellow shadow and small confetti marks around it