dotlottie-rs is the cross-platform dotLottie runtime written in Rust. It is the engine powering all official dotLottie players — delivering the full dotLottie feature set (theming, state machines, multi-animation, and more) with guaranteed visual consistency across every platform.
It exposes a C API (via cbindgen) for native platforms and wasm-bindgen bindings for WebAssembly, serving as the core of the dotLottie players for Web, Android, iOS, Flutter, and React Native.
flowchart TD
A[dotLottie-web] --> WASM[WASM / wasm-bindgen]
B[dotLottie-ios] --> CAPI[C API]
C[dotLottie-android] --> CAPI
D[dotLottie-flutter] --> CAPI
E[dotLottie-react-native] --> CAPI
WASM --> dotlottiers[dotlottie-rs]
CAPI --> dotlottiers
dotlottiers --> Thorvg[Thorvg\Lottie renderer]
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".
- Cross-platform: single Rust codebase targeting Android, iOS, Web, Flutter, React Native, and desktop
- Guaranteed visual consistency: powered by the ThorVG renderer across all platforms
- Theming & slots: runtime color, scalar, text, and vector slot overrides
- State machines: declarative interactivity engine with guards, transitions, and actions
- Multi-animation: playback control over multiple animations within a single
.lottiefile - dotLottie format: full support for the
.lottiecontainer (ZIP-based, manifest v1 & v2, embedded assets) - C API: cbindgen-generated header for native integration (Android NDK, iOS, desktop)
- WASM: wasm-bindgen bindings for WebAssembly targets
dotlottie-rs is the runtime core used by all official dotLottie framework players:
- dotlottie-rs: The core library for dotLottie native players, including the C API (feature:
c_api) and wasm-bindgen bindings (feature:wasm-bindgen-api) - examples/c_api: Example usage of the native C API
The following instructions cover building release artifacts for Android, Apple, WASM, Linux, and native platforms using the Makefile-based build system. For Rust development, just use cargo as usual — no special setup is needed.
You will need GNU make installed. Note that Apple platform targets (iOS, macOS, tvOS, visionOS) require a Mac with Xcode. To ensure that your machine has all the necessary tools installed, run the following from the root of the repo:
make setupThis will configure all platforms. You can also setup individual platforms using:
make android-setup- Setup Android environment (requires Android NDK)make apple-setup- Setup Apple environment (requires Xcode)make wasm-setup- Setup WASM environment (installs wasm-pack and wasm32-unknown-unknown target)
Builds can be performed for the following groups of targets:
android- All Android architectures (ARM64, x86_64, x86, ARMv7)apple- All Apple platforms (macOS, iOS, tvOS, visionOS, macCatalyst)wasm- WebAssembly (software renderer) via wasm-bindgenwasm-webgl- WebAssembly with WebGL2 renderer via wasm-bindgenwasm-webgpu- WebAssembly with WebGPU renderer via wasm-bindgennative- Native library for current platform (C API via cbindgen)native-opengl- Native library with OpenGL renderernative-webgpu- Native library with WebGPU rendererlinux- Linux x86_64 and ARM64
For android and apple, builds will be performed for all supported architectures, whereas
for wasm, only a single target will be built. These names refer to Makefile targets that can be
used to build them. For example, to build all android targets, execute the following:
make androidYou can also build specific architectures:
make android-aarch64 # Android ARM64 only
make apple-macos-arm64 # macOS ARM64 onlyThe default target shows the help menu:
make # Shows comprehensive helpThe C bindings can be generated by using the following command, which will place the include and library
files in release/native:
make nativeOn Windows, you should use the Makefile.win make file:
make -f Makefile.win nativeExamples for using the native interface can be found in the examples directory, which also contains a
README with information on getting started.
test: Run all tests with single-threaded executionclippy: Run Rust linter with strict settingsclean: Clean all build artifacts and Cargo cachelist-platforms: Show all supported platforms
For platform-specific cleanup:
android-clean: Clean Android artifactsapple-clean: Clean Apple artifactswasm-clean: Clean WASM artifactsnative-clean: Clean native artifacts
More information can be found by using the help target:
make helpManually execute the Create Release PR Github Action workflow to create a release PR. This will
include all changes since the last release. This repo uses changesets
to determine the new release version. The knope tool can be installed locally
and used to simply the creation of changeset files.
The release PR should be checked for correctness and then merged. Once that is done, the Release
Github Actions workflow will be started automatically to do the work of actually creating the new
release and building & uploading the related release artifacts.
