Command Palette

Search for a command to run...

lottie-js (Legacy)

Migration guide from lottie-js to dotlottie-js

lottie-js (Legacy)

Overview

lottie-js was a JavaScript library for working with Lottie animations and creating .lottie files. This library is now deprecated and no longer maintained. Users should migrate to @lottiefiles/dotlottie-js, which offers improved performance, better type safety, and active development.

⚠️
Warning

Deprecated: lottie-js is no longer maintained. Please migrate to dotlottie-js for continued support and new features.

What was lottie-js?

lottie-js was an early library designed to:

  • Load and manipulate Lottie JSON animations

  • Create .lottie files programmatically

  • Bundle multiple animations with assets

  • Provide a simple API for animation management

While it served its purpose, the library had limitations in architecture, performance, and TypeScript support that led to the development of a modern replacement.

Why Migrate to dotlottie-js?

The new @lottiefiles/dotlottie-js library provides:

  • Modern Architecture: Built from the ground up with modern JavaScript standards

  • Better Performance: Optimized file handling and memory management

  • TypeScript Support: Full type definitions for better developer experience

  • Active Maintenance: Regular updates, bug fixes, and new features

  • Improved API: More intuitive and consistent method naming

  • Enhanced Features: Support for themes, state machines, and advanced animations

  • Better Error Handling: Clearer error messages and validation

Key Differences

Featurelottie-js (Legacy)dotlottie-js (Modern)
Package Namelottie-js@lottiefiles/dotlottie-js
API StyleCallback-basedPromise-based (async/await)
TypeScriptLimitedFull support
Module SystemCommonJSESM + CommonJS
Bundle Size~45KB~35KB (optimized)
DocumentationMinimalComprehensive
MaintenanceDeprecatedActive

Migration Timeline

  • March 2024: lottie-js marked as deprecated

  • June 2024: Final security updates only

  • December 2024: End of life - no further updates

ℹ️
Info

We recommend migrating as soon as possible to benefit from ongoing improvements and security updates.

Quick Migration Checklist

Before you start migrating, review this checklist:

  • Review your current usage of lottie-js

  • Check the Migration Guide for API changes

  • Update package dependencies

  • Convert callback patterns to async/await

  • Update import/require statements

  • Test thoroughly in your environment

  • Remove lottie-js from dependencies

Migration Resources

Getting Help

If you encounter issues during migration:

  1. Check the Migration Guide for common patterns

  2. Review the Legacy API Reference

  3. Consult the dotlottie-js documentation

  4. Ask questions in our community Discord

  5. Report issues on GitHub

Simple Example

Here's a quick preview of the migration:

const lottie = require("lottie-js");

lottie.loadAnimation({
  path: "animation.json",
  callback: (animation) => {
    console.log("Animation loaded:", animation);
  },
  error: (err) => {
    console.error("Error:", err);
  },
});

The new API is cleaner, uses modern async/await patterns, and provides better error handling.

Next Steps

Ready to migrate? Start with the Migration Guide for detailed instructions and code examples.

Last updated: April 10, 2026 at 9:12 AMEdit this page