npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ngx-dotlottie-web

v0.0.1

Published

Lottie and DotLottie player for Angular

Downloads

754

Readme

Angular Ngx-dotlottie-web

GitHub codecov build tests

Contents

Introduction

An Angular library for rendering lottie and dotLottie animations in the browser.

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.

Installation

You can install this package using npm:

npm install ngx-dotlottie-web

Basic Usage

Import and use the components in your Angular application:

// app.component.ts
import { DotLottieWebComponent } from 'ngx-dotlottie-web';
import { DotLottieWebWorkerComponent } from 'ngx-dotlottie-web/webworker';

@Component({
  // ...
  imports: [DotLottieWebComponent, DotLottieWebWorkerComponent],
  // ...
})

Basic usage in your template:

<!-- Regular dotLottie player -->
<dotlottie-web
  [src]="'path/to/animation.lottie'"
  [autoplay]="true"
  [loop]="true"
></dotlottie-web>

<!-- Web Worker based player (better performance) -->
<dotlottie-webworker
  [src]="'path/to/animation.lottie'"
  [autoplay]="true"
  [loop]="true"
  workerId="unique-worker-id"
></dotlottie-webworker>

Live Examples

Demo

APIs

DotLottieWebComponent

DotLottieWebComponent Input Props

The DotLottieWebComponent accepts the following props with their detailed primitive types:

| Prop | Type | Description | |-----------------------|------------------------|-------------------------------------------------------------------| | autoplay | boolean | Enables or disables automatic playback of the animation. | | backgroundColor | string | Sets the background color of the animation. | | src | string | Specifies the source URL or data for the animation. | | layout | string | Determines the layout configuration for rendering. | | loop | boolean | Controls whether the animation should loop. | | marker | string | Defines markers within the animation timeline. | | mode | string | Sets the rendering mode for the animation. | | autoResize | boolean | Enables automatic resizing of the animation canvas. | | freezeOnOffscreen | boolean | Freezes the animation when it goes offscreen. | | devicePixelRatio | number | Adjusts rendering based on the device’s pixel ratio. | | segment | Array<number, number> | Specifies starting and ending frames for segmented playback. | | speed | number | Sets the playback speed of the animation. | | themeId | string | Identifies the theme to be applied. | | animationId | string | Optional identifier for the animation instance. | | useFrameInterpolation | boolean | Enables frame interpolation for smoother animations. | | canvasClass | string | string[] | CSS classes to be applied to the canvas element. | | freeze | boolean | Manually freezes the animation playback. | | play | boolean | Triggers playback of the animation. | | stop | boolean | Stops the animation playback. |

DotLottieWebworkerComponent

DotLottieWebworkerComponent Input Props

Accepts the same input props as the DotLottieWebComponent in addition to the following:

| Prop | Type | Description | |---------|--------|--------------------------------------------------| | workerId | string | Unique identifier for the web worker instance. |

Listening to Events

Output Props

| Prop | Type | Description | |------------|--------------------------------------|---------------------------------------------------------------------| | lottieInit | DotLottie or DotLottieWorker instance | Emits the lottie instance when it's initialized (either rendered directly or via a web worker). |

You can listen to regular lottie events and perform direct actions with the lottie instance.

Here is an example. In your component's template, bind to the lottieInit output:

<dotlottie-web
  [src]="'path/to/animation.lottie'"
  [autoplay]="true"
  (lottieInit)="onLottieInit($event)">
</dotlottie-web>

In the corresponding TypeScript file, define the handler:

import { Component } from '@angular/core';

@Component({
  selector: 'app-animation',
  templateUrl: './animation.component.html'
})
export class AnimationComponent {
  onLottieInit(lottieInstance: any) {
    console.log('Lottie initialized:', lottieInstance);
    // Custom logic with the lottie instance
  }
}

dotLottie instance exposes multiple events that can be listened to. You can find the list of events here.

Development

Setup

Clone the repository and install dependencies using your preferred package manager (e.g., pnpm):

git clone https://github.com/victor-enogwe/ngx-dotlottie-web.git
cd ngx-dotlottie-web
pnpm install

Dev

For local development, run the development server to see live changes:

pnpm start

Build

To compile the library for production, use:

pnpm run build

You can also build the demo project with:

pnpm run build:demo

Testing

Run unit tests with Jest:

pnpm test

For end-to-end tests:

pnpm test:e2e

To launch Cypress for interactive testing:

pnpm cypress:open

License

MIT