In this note, I will introduce the basic usage of Lottie for those who are thinking, "I want to start using Lottie," or those who are wondering, "I know the name, but what is Lottie?"
What is Lottie?
When you search for the keyword "Lottie" on Google, two terms appear: Lottie and LottieFiles. Here, I will first introduce the differences between the two.
LottieLottie is a JSON-based animation file format developed by Airbnb. Its features are that it is lighter than video or GIF, and the image does not become pixelated even when scaled up or down.
Furthermore, it can be used for various animations, such as illustrations for websites and apps, as well as logo animations, loading screens, and like buttons.
Also, since animations created in After Effects can be exported as Lottie, coordination between engineers and designers regarding animations becomes smoother.
Currently, you can also create them using the following methods:
・Exporting Figma Smart Animate via a plugin
・Lottie CreatorExporting using
LottieFiles is a service where you can search for and download Lottie animations created by creators around the world.
Many Lottie files are published for free, and you can easily edit them within LottieFiles or export code for development.
By creating an account, you can save "edited Lottie files" or "Lottie files you created yourself."
As of May 2023, you can create an account for free, and since an account is required to use it in conjunction with Figma, Adobe XD, After Effects, etc., I recommend creating an account for now.
LottieFiles Pricing Plans
LottieFiles offers paid plans, which differ in features such as the ability to download compressed Lottie files, the number of Lottie files you can save in your workspace, and the availability of version control features.
However, since you can use it on websites even with the free version, you won't have any trouble starting with the free plan.
How to use LottieFiles
Here, I will introduce how to operate LottieFiles and its basic functions.
Creating an accountTo create an account, access theLottieFiles websiteand select the Sign up button in the top right of the screen.
You can easily create a LottieFiles account using your Google account or similar.
You will use the same account for the Adobe XD, Figma, and After Effects plugins.
Once you create an account, a workspace will be provided. You can save "edited Lottie files" or "Lottie files you created yourself" here. By default, the following three animations are saved.
You can also open your workspace from your icon in the top right of LottieFiles.
Search and DownloadThere are two ways to search for free Lotties:
Select Free Animations from Products in the global navigation
Search by keyword in the search bar, then select Free under Price
If you find a Lottie you like, select "Lottie JSON" from the Download button in the top right. If it is a paid version, you can also select Optimized Lottie JSON and other options.
EditIn LottieFiles, you can edit your favorite Lotties found through search. The main editing options are the following three:
Color
Size
Speed
To edit a Lottie, select "Edit Animation" at the bottom of the page to open the Lottie Editor.
Layers are displayed on the left side of the screen, and you can change colors using the "Edit" tab on the right.
To change the size or speed, select the "Settings" tab.
Change the Dimension to adjust the size.
Change the Duration or Frame rate to adjust the speed.
Duration is the number of seconds the animation plays, and Frame rate is the number of frames played per second.
From the seek bar in the diagram above (Settings), we can see that the entire animation has 36 frames, so the current setting means 'play 36 frames per second, and the 36-frame animation will finish exactly'.
If you try changing the Duration to 2, the Frame rate will change to 18, resulting in an 'animation that plays 36 frames over 2 seconds (0.5x speed)'.
You can save the completed animation to your workspace by pressing Save, or save it locally by pressing the download icon.
If you save it to your workspace, you will be taken to a screen to rename it and select a save destination.
LottieFiles allows you to register Lotties downloaded from other marketplaces or Lotties you created yourself to your workspace.
However, please note that if you perform a 'Publish to Public' to LottieFiles, which will be described later, the data will become searchable and downloadable by all users.
Please also check the terms of service regarding publishing to LottieFiles.
Here is a basic method for easily implementing Lottie.
When using a Lottie posted on LottieFiles
Select the Lottie and then select the 'HTML icon' at the bottom of the page.
The Web Player will appear, and once you select the PLAY MODE, size, presence of a seek bar, etc., the code will be generated, which you can then copy and paste to implement.
If you are using multiple Lotties, you only need one of the following codes.
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
As a note of caution, if a creator deletes their account, the asset link will become invalid. To avoid this, you need to download the JSON data and re-upload it to your own server. In that case, the code will look like the following.
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"> </script><lottie-player src="◾️◾️◾️自分のサーバーの格納先◾️◾️◾️" 〜略〜></lottie-player>
When using a Lottie saved in your workspace
When using an 'edited Lottie' or a 'Lottie you created yourself', select 'Handoff & Embed' from 'Share'.
The 'Handoff & Embed' panel will appear, and if you turn on 'Enable Asset Link', code similar to the one mentioned earlier will appear in 'Embed'.
However, with the free plan, asset links are limited to 24 hours. In this case, you can also bypass this by downloading the JSON data and re-uploading it to your own server. (As of December 2023, only the Share feature is restricted)
For advanced settings,
Interactivity Guide contains samples for more advanced configurations.
LottieFiles has the following terms of service.
Animation Upload Guidelines
Lottie Simple License.
LottieFiles Community Guidelines
Inserting into UI design tools
Here, we will introduce how to insert Lottie into UI design tools such as Adobe XD and Figma.
Inserting into Adobe XDTo insert into Adobe XD, you can drag and drop the downloaded Lottie JSON and play it in preview mode.
You can also insert it using the "LottieFiles for Adobe XD" plugin, but it may not be strictly necessary.
Login is required to use the plugin
Figma does not currently support Lottie JSON, so it cannot be inserted via drag and drop.
Therefore, use the "LottieFiles for Figma" plugin.
*Login is required to use the plugin
The insertion format is either SVG or animated GIF; select GIF to play it in the preview.
Creating original Lottie
Creating with After EffectsAnimations created in After Effects can be exported as Lottie using the "Bodymovin" or "LottieFiles for After Effects" plugins. Here, we will introduce how to export using each.
*Some animations, such as those using certain effect features, are not supported
When exporting with the "Bodymovin" plugin
Select Window > Extensions > Bodymovin.
Once Bodymovin launches, check "selected" and specify the save destination using "..." to activate the "Render" button.
Selecting "Render" as is will export the data as a JSON file.
Use "Settings" as needed.
When exporting with the "LottieFiles" plugin
Select Window > Extensions > LottieFiles.
Once LottieFiles launches, select the "→" mark.
A preview screen will appear; select "Save to workspace" to save it to your LottieFiles workspace.
Creating with FigmaUsing the "LottieFiles for Figma" plugin, you can create Lottie animations from Smart Animate designs made in Figma.
Some features are not supported.
Publish to Public on LottieFiles
You can publish the Lottie you created to LottieFiles.
Published Lotties become searchable and usable by all users.
To publish a Lottie, select the "Publish to Public" tab from the "Share" button in your workspace. Clicking the "Publish" button will take you to the registration screen.
It takes time for it to actually be posted.