Motion4 min

After Effects to Lottie: a workflow that survives the trip to code

How to export After Effects animations to Lottie for apps and websites: what Lottie supports, setup tips, file size, dotLottie, testing and handoff.

Saurabh YadavFounder, Design Studio by Saurabh
MotionLottieAfter EffectsUI animation
Share

Lottie is one of the best things to happen to UI animation. You design in After Effects, export a small JSON file, and developers play it natively on iOS, Android and the web, crisp at any size.

But anyone who has shipped Lottie knows the pain: an animation that looks perfect in After Effects arrives broken, huge or missing effects. Here's the workflow I use to avoid that.

How Lottie works

Lottie files describe vector shapes, transforms and keyframes as data. A Lottie player in the app reads that data and draws the animation in real time. The original exporter is the Bodymovin plugin for After Effects, and LottieFiles offers its own plugin and tools too.

Because it's vector data, not video, Lottie is sharp, small and controllable: developers can play, pause, loop, scrub or trigger parts of it from code.

Design for Lottie from the start

The biggest mistake is animating freely and hoping it exports. Instead, set up for Lottie from the first frame.

Usually works wellAvoid or test carefully
Shape layersMost After Effects effects (blurs, glows, distortions)
Position, scale, rotation, opacityExpressions (support is limited)
Trim paths3D layers and cameras
Masks and mattes (used sparingly)Heavy use of mattes and masks
Simple gradientsRaster images and video layers
Text converted to shapesLive text that depends on fonts

Note

Support varies between players and platforms. Always check your target players before relying on a specific feature, and test on real devices.

My After Effects setup for Lottie

  1. Work in shape layers. Import Illustrator files and convert them to shapes. Clean up unnecessary groups.
  2. Pre-compose thoughtfully. Nesting is fine, but deep nesting makes files bigger and debugging harder.
  3. Bake expressions. If you used expressions, convert them to keyframes before export.
  4. Keep frame rates sensible. 30 fps is plenty for most UI animation.
  5. Name your layers. Developers can target named layers, for example to change a colour.

Keep file size small

TipWhy
Fewer keyframesEvery keyframe is data
Simplify pathsFewer points, smaller file
Avoid embedded imagesImages bloat the file fast
Reuse precompsRepeated content compresses better
Use dotLottieA compressed format that can bundle multiple animations

dotLottie (.lottie) is a zipped format from LottieFiles that makes files smaller and can bundle several animations and themes in one file. Check that your developers' player supports it.

Test before handoff

  • Preview the export in a Lottie previewer, not just in After Effects.
  • Test on iOS, Android and web if you ship to all three.
  • Test on a budget Android phone. Smooth on a flagship doesn't mean smooth everywhere.
  • Check the first and last frames, since those show when the animation is paused.

Hand off like a pro

Give developers more than a file:

  • When it plays (on load, on tap, on success).
  • Whether it loops, and between which frames.
  • Named markers for segments, such as "idle", "loading" and "done".
  • Size, colour changes and reduced-motion behaviour.

Tip

Provide a static fallback frame for users who turn on reduced motion. My guide to accessible motion design explains why.

Not sure Lottie is the right choice? I compare it with Rive and CSS in Lottie vs Rive vs CSS.

Work with us

Need motion for your product? Our motion design studio creates UI animation, Lottie and Rive assets and product videos.

FAQ

How do I export a Lottie animation from After Effects?

Use an exporter plugin such as Bodymovin or the LottieFiles plugin. Build your animation with shape layers and simple transforms, select the composition, export it as JSON or dotLottie, then preview and test it in a Lottie player.

Why does my Lottie animation look different from After Effects?

Usually because it uses features Lottie players don't fully support, such as certain effects, expressions, 3D layers or complex mattes. Rebuild those parts with shape layers and keyframes, and test in the target player.

What is dotLottie?

dotLottie is a compressed file format for Lottie animations. It produces smaller files and can bundle multiple animations, images and themes into one file, as long as the app's player supports it.

Key takeaways

  • Lottie turns After Effects animations into small, sharp, code-controllable files.
  • Design with shape layers and simple transforms from the start.
  • Bake expressions, avoid heavy effects and keep keyframes lean.
  • Test on real devices, including budget Android phones.
  • Hand off with triggers, loops, markers and a reduced-motion fallback.

What to do next

Open your next animation and check every layer against the table above before you animate further. If you need motion that ships cleanly in your app, tell us about it.

Saurabh Yadav's Memoji

Written by

Saurabh Yadav

Founder of Design Studio by Saurabh, a UI/UX design studio in India. We design apps and websites that feel effortless, from research to shipped pixels. Most recently: Pukaar.ai, as seen on Shark Tank India, and the Demerara Bank app.

Keep reading

All articles →