Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lottiefiles/dotlottie-react

Package Overview
Dependencies
Maintainers
4
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lottiefiles/dotlottie-react

React wrapper around the dotlottie-web library

  • 0.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
89K
increased by29.43%
Maintainers
4
Weekly downloads
 
Created
Source

@lottiefiles/dotlottie-react

npm npm bundle size npm NPM

🚧 Beta Alert: We're still refining! The APIs in this package may undergo changes.

Contents

  • Introduction
  • Installation
  • Usage
  • APIs
  • Development

Introduction

A React 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

npm install @lottiefiles/dotlottie-react

Usage

import React from 'react';
import { DotLottieReact } from '@lottiefiles/dotlottie-react';

const App = () => {
  return (
    <DotLottieReact
      src="path/to/animation.lottie"
      loop
      autoplay
    />
  );
};

APIs

DotLottieReactProps

Property nameTypeRequiredDefaultDescription
autoplaybooleanfalseAuto-starts the animation on load.
loopbooleanfalseDetermines if the animation should loop.
srcstringundefinedURL to the animation data (.json or .lottie).
speednumber1Animation playback speed. 1 is regular speed.
datastring | ArrayBufferundefinedAnimation data provided either as a Lottie JSON string or as an ArrayBuffer for .lottie animations.
modestring"forward"Animation play mode. Accepts "forward", "reverse", "bounce", "bounce-reverse".
backgroundColorstringundefinedBackground color of the canvas. Accepts 6-digit or 8-digit hex color string (e.g., "#000000", "#000000FF"),
segments[number, number][0, totalFrames - 1]Animation segments. Accepts an array of two numbers, where the first number is the start frame and the second number is the end frame.
renderConfigRenderConfig{}Configuration for rendering the animation.
RenderConfig

The renderConfig object accepts the following properties:

Property nameTypeRequiredDefaultDescription
devicePixelRationumberwindow.devicePixelRatio | 1The device pixel ratio.

Development

Setup

pnpm install

Dev

pnpm dev

Build

pnpm build

Keywords

FAQs

Package last updated on 12 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc