Agent skill

Dotlottie Web

by LottieFiles in LottieFiles/dotlottie-web

Implement Lottie animations using dotLottie runtimes (@lottiefiles/dotlottie-web and @lottiefiles/dotlottie-react).

MITAuto-check passedMedia & Creative

Install Dotlottie Web

skills CLI
$ npx skills add LottieFiles/dotlottie-web --skill dotlottie-web -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install LottieFiles/dotlottie-web dotlottie-web --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dotlottie-web
GitHub stars
892
Token cost
~3.5k tokens
SKILL.md length
552 words
Files
554 (incl. scripts, references, assets)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Implement Lottie animations using dotLottie runtimes (@lottiefiles/dotlottie-web and @lottiefiles/dotlottie-react).

  • Works in 6 steps: Use Web Workers for Complex Animations → Lazy Load Animations → Auto-Freeze is Enabled by Default → …
  • Optimizing dotLottie
  • SKILL.md covers Package Selection, Installation, Basic Implementation and .lottie vs .json, plus 8 more sections
  • Calls npm; reaches dotlottie.io

What it does

Dotlottie Web is an agent skill from LottieFiles/dotlottie-web. Implement Lottie animations using dotLottie runtimes (@lottiefiles/dotlottie-web and @lottiefiles/dotlottie-react). Use when building, debugging, or optimizing dotLottie or Lottie animations in web projects, including vanilla JS, React, and Next.js. Covers package selection, Web Workers, state machines, theming, dynamic slot overriding, performance best practices, and common patterns.

Its SKILL.md is about 3.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 557 other files, including scripts, reference files and assets (for example `.changeset/README.md`, `.changeset/config.json` and `.changeset/drop-video-support.md`).

It sits in Media & Creative, covering Motion graphics and Theming and dark mode. It works with Lottie, React, JavaScript and Next.js. The repository describes itself as: High-performance Lottie & dotLottie web player powered by Rust + WASM, with React, Vue, Svelte, Solid & Web Components. The licence is MIT.

When your agent uses it

  • Optimizing dotLottie
  • Lottie animations in web projects
  • Including vanilla JS

Example prompts

  • “/dotlottie-web”

Requirements

  • Node.js

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Use Web Workers for Complex Animations
  2. Lazy Load Animations
  3. Auto-Freeze is Enabled by Default
  4. Device Pixel Ratio
  5. Clean Up (Vanilla JS only)
  6. Frame Interpolation Control

What it can do on your machine

Read from SKILL.md and the folder at commit d8a4e9e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • dotlottie.io

    Also links to:

    • developers.lottiefiles.com
    • lottiefiles.com
    • creators.lottiefiles.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dotlottie Web loads about 3.5k tokens when it runs, and up to ~5k if it reads all its reference files. Until then it costs about 100 tokens; SKILL.md has 552 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~100
When it runs · the whole SKILL.md, loaded when a task matches
~3.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from LottieFiles/dotlottie-web at commit d8a4e9e, republished under its MIT licence (© LottieFiles). 552 words, ~3,477 tokens.

Download SKILL.mdSave it as .claude/skills/dotlottie-web/SKILL.md (or your agent's skills folder). This skill also uses 553 other files; get the full folder from GitHub.
name
dotlottie-web
description
Implement Lottie animations using dotLottie runtimes (@lottiefiles/dotlottie-web and @lottiefiles/dotlottie-react). Use when building, debugging, or optimizing dotLottie or Lottie animations in web projects, including vanilla JS, React, and Next.js. Covers package selection, Web Workers, state machines, theming, dynamic slot overriding, performance best practices, and common patterns.
license
MIT
metadata.author
lottiefiles
metadata.version
1.0.0
metadata.source
https://github.com/LottieFiles/dotlottie-web

dotLottie Implementation Guidelines

You are an expert at implementing Lottie animations using dotLottie runtimes. Follow these guidelines when working with dotLottie in web projects.

Package Selection

Use @lottiefiles/dotlottie-web when:
  • You need direct canvas control
  • Building framework-agnostic code
  • Maximum performance is critical
  • You want the smallest bundle
Use @lottiefiles/dotlottie-react when:
  • Building React applications
  • You want declarative component API
  • You need React lifecycle integration

Installation

bash
# Web (vanilla JS, Vue, Svelte, etc.)
npm install @lottiefiles/dotlottie-web

# React
npm install @lottiefiles/dotlottie-react

Basic Implementation

Vanilla JavaScript
typescript
import { DotLottie } from '@lottiefiles/dotlottie-web';

const dotLottie = new DotLottie({
  canvas: document.getElementById('canvas') as HTMLCanvasElement,
  src: 'https://example.com/animation.lottie',
  autoplay: true,
  loop: true,
});
React
tsx
import { DotLottieReact } from '@lottiefiles/dotlottie-react';

function Animation() {
  return (
    <DotLottieReact
      src="https://example.com/animation.lottie"
      autoplay
      loop
    />
  );
}
React with Instance Control
tsx
import { useRef } from 'react';
import { DotLottieReact } from '@lottiefiles/dotlottie-react';
import type { DotLottie } from '@lottiefiles/dotlottie-web';

function Animation() {
  const dotLottieRef = useRef<DotLottie | null>(null);

  return (
    <DotLottieReact
      src="https://example.com/animation.lottie"
      dotLottieRefCallback={(dotLottie) => (dotLottieRef.current = dotLottie)}
    />
  );
}

.lottie vs .json

Always prefer .lottie format over .json:

  • Smaller file size (compressed)
  • Supports multiple animations in one file
  • Embedded assets (images, fonts)
  • State machines for interactivity
  • Theming with slots

Use DotLottieWorker to offload animation rendering to a Web Worker, keeping the main thread free for UI interactions:

Basic Worker Usage
typescript
import { DotLottieWorker } from '@lottiefiles/dotlottie-web';

const dotLottie = new DotLottieWorker({
  canvas: document.getElementById('canvas') as HTMLCanvasElement,
  src: 'https://example.com/animation.lottie',
  autoplay: true,
  loop: true,
});
Worker Grouping (Multiple Animations)

By default, all DotLottieWorker instances share the same worker. Group animations into separate workers using workerId:

typescript
// Hero animation in its own worker
const heroAnimation = new DotLottieWorker({
  canvas: heroCanvas,
  src: 'hero.lottie',
  workerId: 'hero-worker',
});

// UI animations share a different worker
const buttonAnimation = new DotLottieWorker({
  canvas: buttonCanvas,
  src: 'button.lottie',
  workerId: 'ui-worker',
});
When to Use Workers
  • Use DotLottieWorker for:

    • Multiple simultaneous animations
    • Complex animations with many layers
    • Animations running alongside heavy JS operations
    • Mobile devices where main thread performance is critical
  • Use regular DotLottie for:

    • Single simple animations
    • When you need synchronous frame access
    • SSR environments (workers not available)
React with Workers
tsx
import { DotLottieWorkerReact } from '@lottiefiles/dotlottie-react';

function Animation() {
  return (
    <DotLottieWorkerReact
      src="animation.lottie"
      autoplay
      loop
      workerId="my-worker" // Optional: dedicate to specific worker
    />
  );
}

State Machines (Interactivity)

State machines enable interactive animations without code. See the State Machine Guide for details.

typescript
const dotLottie = new DotLottie({
  canvas,
  src: 'interactive.lottie', // Contains state machine
  autoplay: true,
});

// Fire events to trigger state transitions
dotLottie.stateMachineFireEvent('click');
dotLottie.stateMachineFireEvent('hover');
dotLottie.stateMachineFireEvent('custom-event');

// Set numeric/boolean/string inputs for state conditions
// See: https://github.com/LottieFiles/dotlottie-web/wiki/dotLottie-State-Machine-Guide#working-with-inputs
dotLottie.stateMachineSetNumericInput('progress', 0.5);
dotLottie.stateMachineSetBooleanInput('isActive', true);
dotLottie.stateMachineSetStringInput('mode', 'dark');
State Machine Events
  • click - User click/tap
  • hover - Mouse enter
  • unhover - Mouse leave
  • complete - Animation finished
  • Custom events defined in the state machine

Theming with Slots

Slots allow runtime color/value customization. Themes follow the dotLottie 2.0 spec.

typescript
const dotLottie = new DotLottie({
  canvas,
  src: 'themed.lottie',
  themeId: 'dark-mode', // Use embedded theme by ID
});

// Or apply theme data directly (JSON string per dotLottie 2.0 spec)
// See: https://dotlottie.io/spec/2.0/#themes
dotLottie.setThemeData(JSON.stringify({
  rules: [
    { id: 'primary-color', value: [1, 0.34, 0.13] }, // RGB values 0-1
  ]
}));

Dynamic Slot Overriding

Slots enable runtime customization of animated properties using typed APIs. Available slot types: color, scalar, vector, gradient, text, image.

Key APIs: getSlotIds(), getSlotType(), setColorSlot(), setScalarSlot(), setVectorSlot(), setGradientSlot(), setTextSlot(), resetSlot(), clearSlots().

For complete API reference with code examples for each slot type, animated keyframes, resetting, bulk updates, common use cases (branding, dark mode, progress indicators), and React integration, see Dynamic Slots Reference.

Markers & Segments

Playing Specific Segments
typescript
// Play frames 0-60
dotLottie.setSegment(0, 60);
dotLottie.play();

// Play by marker name (defined in animation)
dotLottie.setMarker('intro');
dotLottie.play();
Getting Markers
typescript
const markers = dotLottie.markers();
// Returns: [{ name: 'intro', time: 0, duration: 60 }, ...]
Show full SKILL.md (230 more words)Show less

Rendering a Specific Frame to an Image

Set autoplay: false so playback doesn't advance past your target, then call setFrame() after load. setFrame() renders synchronously, so the canvas and dotLottie.buffer (RGBA Uint8Array) hold that exact frame immediately after the call.

Browser
typescript
const dotLottie = new DotLottie({ canvas, src: 'animation.lottie', autoplay: false });

dotLottie.addEventListener('load', () => {
  dotLottie.setFrame(42);                        // render frame 42
  const dataUrl = canvas.toDataURL('image/png'); // or canvas.toBlob(cb, 'image/png')
});
Node.js (@napi-rs/canvas)
typescript
import fs from 'node:fs';
import { createCanvas } from '@napi-rs/canvas';

const canvas = createCanvas(200, 200);
const dotLottie = new DotLottie({
  canvas: canvas as unknown as HTMLCanvasElement,
  src: 'animation.lottie',
  autoplay: false,
});

dotLottie.addEventListener('load', async () => {
  dotLottie.setFrame(42);
  fs.writeFileSync('frame-42.png', await canvas.encode('png'));
  dotLottie.destroy();
});

For custom encoding, read raw RGBA pixels directly from dotLottie.buffer (length = width × height × 4).

Event Handling

typescript
dotLottie.addEventListener('load', () => {
  console.log('Animation loaded');
});

dotLottie.addEventListener('play', () => {
  console.log('Playing');
});

dotLottie.addEventListener('complete', () => {
  console.log('Animation completed');
});

dotLottie.addEventListener('frame', ({ currentFrame }) => {
  console.log('Frame:', currentFrame);
});

// Clean up
dotLottie.removeEventListener('load', handler);

Performance Best Practices

1. Use Web Workers for Complex Animations
typescript
import { DotLottieWorker } from '@lottiefiles/dotlottie-web';

// Offload rendering to worker thread
const dotLottie = new DotLottieWorker({
  canvas,
  src: 'complex-animation.lottie',
});
2. Lazy Load Animations
typescript
// Only load when visible
const observer = new IntersectionObserver((entries) => {
  entries.forEach(entry => {
    if (entry.isIntersecting) {
      loadAnimation();
      observer.disconnect();
    }
  });
});
observer.observe(container);
3. Auto-Freeze is Enabled by Default

DotLottie automatically freezes animations when they're not visible (offscreen). To disable this behavior:

typescript
const dotLottie = new DotLottie({
  canvas,
  src: 'animation.lottie',
  renderConfig: {
    freezeOnOffscreen: false, // Disable auto-freeze (not recommended)
  },
});
4. Device Pixel Ratio

By default, devicePixelRatio is set to 75% of the actual value for better performance. For full retina quality (with higher performance cost):

typescript
const dotLottie = new DotLottie({
  canvas,
  src: 'animation.lottie',
  renderConfig: {
    devicePixelRatio: window.devicePixelRatio, // Full retina (higher CPU/GPU)
  },
});
5. Clean Up (Vanilla JS only)
typescript
// Always destroy when done (vanilla JS)
dotLottie.destroy();

Note: DotLottieReact handles cleanup automatically on unmount - no manual cleanup needed.

6. Frame Interpolation Control
typescript
const dotLottie = new DotLottie({
  canvas,
  src: 'animation.lottie',
  useFrameInterpolation: true,  // Smooth playback (default)
  // useFrameInterpolation: false, // Match original AE frame rate
});

Multi-Animation Files

A single .lottie file can contain multiple animations:

typescript
// Load specific animation by ID
dotLottie.loadAnimation('animation-2');

// Get all animation IDs
const animations = dotLottie.manifest?.animations;
// Returns: [{ id: 'animation-1' }, { id: 'animation-2' }]

Canvas Sizing

Set canvas size via CSS styles (recommended). DotLottie will automatically determine the optimal drawing area:

html
<canvas id="canvas" style="width: 400px; height: 400px;"></canvas>
Auto-Resize to Container

Use the autoResize render config to automatically resize when the container changes:

typescript
const dotLottie = new DotLottie({
  canvas,
  src: 'animation.lottie',
  renderConfig: {
    autoResize: true, // Canvas resizes to fit container
  },
});

Common Patterns

Play on Hover
typescript
canvas.addEventListener('mouseenter', () => dotLottie.play());
canvas.addEventListener('mouseleave', () => dotLottie.pause());
Play on Click (Once)
typescript
canvas.addEventListener('click', () => {
  dotLottie.setFrame(0);
  dotLottie.setLoop(false);
  dotLottie.play();
});
Scrub with Scroll
typescript
window.addEventListener('scroll', () => {
  const progress = window.scrollY / (document.body.scrollHeight - window.innerHeight);
  const frame = progress * dotLottie.totalFrames;
  dotLottie.setFrame(frame);
});
Loading States (React)
tsx
function Animation() {
  const [isLoaded, setIsLoaded] = useState(false);

  return (
    <>
      {!isLoaded && <Skeleton />}
      <DotLottieReact
        src="animation.lottie"
        style={{ opacity: isLoaded ? 1 : 0 }}
        dotLottieRefCallback={(dotLottie) => {
          dotLottie.addEventListener('load', () => setIsLoaded(true));
        }}
      />
    </>
  );
}
Responsive Animation
tsx
function ResponsiveAnimation() {
  return (
    <DotLottieReact
      src="animation.lottie"
      autoplay
      loop
      style={{ width: '100%', maxWidth: '400px' }}
      renderConfig={{ autoResize: true }}
    />
  );
}

Debugging

typescript
// Check if loaded
console.log('Loaded:', dotLottie.isLoaded);

// Get animation info
console.log('Duration:', dotLottie.duration);
console.log('Total Frames:', dotLottie.totalFrames);
console.log('Current Frame:', dotLottie.currentFrame);
console.log('Is Playing:', dotLottie.isPlaying);
console.log('Loop:', dotLottie.loop);
console.log('Speed:', dotLottie.speed);

// Get manifest (for .lottie files)
console.log('Manifest:', dotLottie.manifest);

Error Handling

typescript
dotLottie.addEventListener('loadError', (error) => {
  console.error('Failed to load animation:', error);
  // Show fallback UI
});

SSR / Next.js Considerations

dotLottie requires browser APIs. For SSR frameworks:

tsx
import dynamic from 'next/dynamic';

const DotLottieReact = dynamic(
  () => import('@lottiefiles/dotlottie-react').then(mod => mod.DotLottieReact),
  { ssr: false }
);

function Animation() {
  return <DotLottieReact src="animation.lottie" autoplay loop />;
}

Resources

© LottieFiles, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 553 other files (scripts, references, assets) in the repository root of LottieFiles/dotlottie-web.

  • SKILL.md
  • .changeset/README.md
  • .changeset/config.json
  • .changeset/drop-video-support.md
  • .changeset/fix-load-config-ids.md
  • .editorconfig
  • .eslintignore
  • .gitattributes
  • .github/CODEOWNERS
  • .github/ISSUE_TEMPLATE/BUG_REPORT.md
  • .github/ISSUE_TEMPLATE/ENHANCEMENT.md
  • .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/SECURITY.md
  • .github/dependabot.yml
  • .github/workflows/ci.yml
  • .github/workflows/deploy-viewer.yml
  • … and 537 more

Open the folder on GitHubat commit d8a4e9e

Compare with similar skills

Dotlottie Web next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dotlottie Web compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dotlottie Web this skillLottieFiles/dotlottie-web892—~3.5kAutomated safety check: PassMIT
Create Remotion GeistMarve10s/Better-Fullstack754—~1.4kAutomated safety check: PassMIT
UI UX Pro Maxshobcoder/shob576—~3.7kAutomated safety check: PassMIT
Motiscope RecreateKumarSashank/motiscope122—~2kAutomated safety check: PassMIT
RecreateKumarSashank/motiscope122—~1.8kAutomated safety check: NotesMIT
Premium UI Revampbuildfastwithai/gen-ai-experiments785—~2kAutomated safety check: PassMIT

Similar skills

  • Create Remotion Geist

    Marve10s/Better-Fullstack

    Create Remotion videos using the Geist design system aesthetic.

    754 GitHub stars~1.4k tokensUpdated yesterday
    Media & CreativeAuto-check passed
  • UI UX Pro Max

    shobcoder/shob

    UI/UX design intelligence expert for web and mobile applications.

    576 GitHub stars~3.7k tokensUpdated 21 days ago
    Frontend & DesignAuto-check passed
  • Motiscope Recreate

    KumarSashank/motiscope

    Recreate an analyzed animation as working web code — GSAP (JavaScript), CSS/Web Animations, Framer Motion (React), or Lottie/SVG.

    122 GitHub stars~2k tokensUpdated 2 mo ago
    Frontend & DesignAuto-check passed
  • Recreate

    KumarSashank/motiscope

    Recreate an analyzed animation as working web code — GSAP (JavaScript), CSS/Web Animations, Framer Motion (React), or Lottie/SVG.

    122 GitHub stars~1.8k tokensUpdated 2 mo ago
    Frontend & DesignAuto-check: notes
  • Premium UI Revamp

    buildfastwithai/gen-ai-experiments

    Audit and revamp existing web interfaces into polished, professional, product-specific experiences while preserving behavior and working within the current frontend stack.

    785 GitHub stars~2k tokensUpdated 17 days ago
    Frontend & DesignAuto-check passed
  • UI UX Pro Max

    majiayu000/spellbook

    A skill your agent uses when planning, building, designing, code review, refactor, fixing, improving, optimizing, enhancing, or checking UI/UX work.

    287 GitHub stars~442 tokensUpdated yesterday
    Frontend & DesignAuto-check passed

Questions about Dotlottie Web

What does Dotlottie Web do?

Implement Lottie animations using dotLottie runtimes (@lottiefiles/dotlottie-web and @lottiefiles/dotlottie-react). Dotlottie Web is an agent skill from LottieFiles/dotlottie-web. Implement Lottie animations using dotLottie runtimes (@lottiefiles/dotlottie-web and @lottiefiles/dotlottie-react).

When should I use Dotlottie Web?

Dotlottie Web fits situations like: optimizing dotLottie; lottie animations in web projects; including vanilla JS.

How do I install Dotlottie Web in Claude Code?

Run `npx skills add LottieFiles/dotlottie-web --skill dotlottie-web -a claude-code`. Or copy the skill folder (the LottieFiles/dotlottie-web repository) into .claude/skills/dotlottie-web in your project. Claude Code loads it when a task matches its description.

How do I install Dotlottie Web in Codex?

Run `npx skills add LottieFiles/dotlottie-web --skill dotlottie-web -a codex`. Or copy the skill folder (the LottieFiles/dotlottie-web repository) into .agents/skills/dotlottie-web in your project. Codex loads it when a task matches its description.

Can I use Dotlottie Web in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LottieFiles/dotlottie-web --skill dotlottie-web -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dotlottie-web, .gemini/skills/dotlottie-web, .github/skills/dotlottie-web and .opencode/skills/dotlottie-web in your project.

What does Dotlottie Web need to run?

Going by SKILL.md and its folder, Dotlottie Web needs the command-line tools its instructions call (npm). Our summary lists: Node.js.

Does Dotlottie Web access the network?

SKILL.md names 4 domains. In commands or code: dotlottie.io; the agent is likely to contact it when it follows the instructions. As links in the text: developers.lottiefiles.com, lottiefiles.com and creators.lottiefiles.com. This is read from the text; nothing was executed.

Is Dotlottie Web safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Dotlottie Web use?

Dotlottie Web is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dotlottie Web use?

About 3.5k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.5k tokens, read only when the agent opens those files.

What are the alternatives to Dotlottie Web?

Skills that share tags, products or a category with Dotlottie Web: Create Remotion Geist (Marve10s/Better-Fullstack, 754 stars), UI UX Pro Max (shobcoder/shob, 576 stars), Motiscope Recreate (KumarSashank/motiscope, 122 stars) and Recreate (KumarSashank/motiscope, 122 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dotlottie Web?

LottieFiles (a GitHub organization) maintains it in LottieFiles/dotlottie-web, which has 892 GitHub stars. The repository was last updated on October 7, 2026.

Source: LottieFiles/dotlottie-web on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.