LottieFiles / dotlottie-web

Official LottieFiles player for rendering Lottie and dotLottie animations in the web. Supports React, Vue, Svelte, SolidJS and Web Components.
https://developers.lottiefiles.com/docs/dotlottie-player/
MIT License
191 stars 11 forks source link
animation canvas dotlottie easy immersive javascript lottie painless thorvg web

CI GitHub contributors Contributor Covenant GitHub

dotLottie Web

Streamline your web animations with LottieFiles' official players for dotLottie and Lottie animations. Designed for quick integration, these packages help developers swiftly bring animated visuals into web projects with minimal effort.

dotLottie web sample 1 dotLottie web sample 2 dotLottie web sample 3 dotLottie web sample 4

What is dotLottie?

dotLottie is an open-source file format that aggregates one or more Lottie files and their associated resources into a single file. They are ZIP archives compressed with the Deflate compression method and carry the file extension of ".lottie".

Learn more about dotLottie.

Contents

Packages

The monorepo contains the following package:

Package Description
@lottiefiles/dotlottie-web A JavaScript library for rendering Lottie and dotLottie animations in the browser or Node.js.
@lottiefiles/dotlottie-react A React component wrapper for dotlottie-web that provides a declarative API for rendering Lottie and dotLottie animations and UI controls for interacting with them.
@lottiefiles/dotlottie-wc A Web Component wrapper for dotlottie-web that provides a declarative API for rendering Lottie and dotLottie animations and UI controls for interacting with them.
@lottiefiles/dotlottie-vue A Vue component wrapper for dotlottie-web that provides a declarative API for rendering Lottie and dotLottie animations and UI controls for interacting with them.
@lottiefiles/dotlottie-svelte A Svelte component wrapper for dotlottie-web that provides a declarative API for rendering Lottie and dotLottie animations and UI controls for interacting with them.

Note: Each package has its own README.md with detailed documentation on usage and APIs.

Getting Started

To contribute to this monorepo or use its packages in your project, follow these setup steps:

Prerequisites

Ensure you have the following installed:

Setup

Clone the monorepo:

git clone https://github.com/LottieFiles/dotlottie-web.git
cd dotlottie-web

Install dependencies:

pnpm install

Live Examples

Local Examples

Discover how to implement and utilize the dotlottie-web packages with our example applications. These examples serve as a practical guide to help you understand how to integrate Lottie and dotLottie animations into your web projects.

Available examples:

Running Examples

git clone https://github.com/LottieFiles/dotlottie-web.git
cd dotlottie-web
pnpm install
pnpm run build
# Change directory to the example app folder
cd apps/dotlottie-web-example 
pnpm run dev

Feel free to modify and play around with the code to see how changes affect the animations.

Development

Building Packages

To build all packages within the monorepo:

pnpm run build

Running Locally

To start a local development environment for all packages:

pnpm run dev

Scripts

Here's a brief explanation of the scripts available in the root package.json:

For a full list of available scripts, see the scripts section in package.json.

Contributing

We welcome contributions to any of the packages in this monorepo. Please read our Contributing Guidelines and our Code of Conduct to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to the project.

License

MIT © LottieFiles