
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@dotlottie/dotlottie-js
Advanced tools
This library helps in creating and modifying .lottie files.
dotLottie-js serves as the primary library for creating and abstracting dotLotties.
Full documentation available here.
Install dotlottie-js
pnpm add @dotlottie/dotlottie-js
npm i @dotlottie/dotlottie-js
yarn install @dotlottie/dotlottie-js
Importing:
import { DotLottie } from '@dotlottie/dotlottie-js'
import { DotLottie } from '@dotlottie/dotlottie-js/node'
For more use cases check out the documentation on gitbook
import { DotLottie } from '@dotlottie/dotlottie-js';
//If running on Node
// import { DotLottie } from '@dotlottie/dotlottie-js/node';
import like_animation from './like.json';
async function createDotLottie(){
const dotLottie = new DotLottie();
// build dotLottie
await dotLottie
.setAuthor('LottieFiles')
.setVersion('1.0')
.addAnimation({
id: 'like_animation',
data: like_animation,
loop: true,
autoplay: true
})
.addAnimation({
id: 'cat_animation',
url: 'https://my_cat_animation.json',
loop: true,
autoplay: false
})
.build()
// download dotLottie
await dotlottie.download('my_animation.lottie');
}
createDotLottie();
A manifest.json file will be present inside of your .lottie.
The manifest file allows the player to know what animations are contained inside it, how to play them and more. All of these settings are customizable by interacting with the DotLottie object and the LottieAnimations contained inside it.
There are two levels of customization possible, the first being on the dotLottie level which concerns things like the author
, version
of the animation and more. The second is on the animation level, setting options like autoplay
, loop
and more.
All of the dotLottie object customization options are visible here.
All of the animation object customization options are visible here.
For examples on how to use in React, Next.js, Vue and Nuxt 3 please refer to the full documentation page.
git clone https://github.com/dotlottie/dotottie-js
cd dotlottie-js
pnpm i
pnpm run build
pnpm run test
FAQs
This library helps in creating and modifying .lottie files.
The npm package @dotlottie/dotlottie-js receives a total of 42,023 weekly downloads. As such, @dotlottie/dotlottie-js popularity was classified as popular.
We found that @dotlottie/dotlottie-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.