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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lottiefiles/dotlottie-wc

v0.3.0

Published

Web component wrapper around the dotlottie-web library

Downloads

80,113

Readme

@lottiefiles/dotlottie-wc

npm npm bundle size npm NPM

Contents

Introduction

A web component for rendering and playing Lottie and DotLottie animations in web applications.

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

npm install @lottiefiles/dotlottie-wc

Usage

Via npm

After installation, you can use dotlottie-wc in your HTML file:

<dotlottie-wc src="https://lottie.host/4db68bbd-31f6-4cd8-84eb-189de081159a/IGmMCqhzpt.lottie" autoplay="true" loop="true"></dotlottie-wc>

And import it in your JavaScript or TypeScript module:

import '@lottiefiles/dotlottie-wc';

Via CDN

You can also use the component directly via a npm CDN:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@lottiefiles/dotlottie-wc | Basic Example</title>
</head>
<body>
    <dotlottie-wc src="https://lottie.host/4db68bbd-31f6-4cd8-84eb-189de081159a/IGmMCqhzpt.lottie" autoplay loop></dotlottie-wc>
    <script type="module" src="https://unpkg.com/@lottiefiles/dotlottie-wc@latest/dist/dotlottie-wc.js"></script>
</body>
</html>

APIs

Attributes

The dotlottie-wc component accepts all configuration attributes of DotLottie from @lottiefiles/dotlottie-web, allowing you to customize your animation as required.

| Attribute | Type | Description | | ----------------- | --------------------- | ------------------------------------------------------------------------------------------------ | | src | string | URL of the Lottie or DotLottie animation. | | autoplay | boolean | Automatically start the animation. | | loop | boolean | Loop the animation. | | speed | number | Playback speed. | | data | string | Animation data as a string or ArrayBuffer for .lottie animations. | | segment | Array | Animation segment as an array of two numbers (start frame and end frame). | | mode | string | Animation play mode (e.g., "forward", "bounce"). | | backgroundColor | string | Background color of the canvas. Accepts 6-digit or 8-digit hex color string (e.g., "#000000FF"). | | renderConfig | Object (RenderConfig) | Configuration for rendering the animation. |

RenderConfig

The renderConfig object accepts the following properties:

| Property name | Type | Required | Default | Description | | ------------------ | ------ | :------: | ----------------------------- | ----------------------- | | devicePixelRatio | number | | window.devicePixelRatio | 1 | The device pixel ratio. |

Properties

The dotlottie-wc exposes the following properties:

| Property name | Type | Description | | ------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | dotLottie | DotLottie | The dotLottie instance from DotLottie , allowing you to call methods and listen to events for more control over the animation. |

Development

Setup

npm install

Dev

npm run dev

Build

npm run build