lottie
heygen-com/hyperframes
Embed and seek lottie-web and dotLottie animations in HyperFrames compositions.
What is lottie?
Adapter for loading and controlling Lottie animations (JSON and .lottie files) within HyperFrames. Use this when you need to embed After Effects exports or pre-built animations and have HyperFrames seek them to specific timeline positions.
- Load lottie-web JSON animations from local project assets
- Load dotLottie (.lottie) files with @lottiefiles/dotlottie-web player
- Register animation instances on window.__hfLottie for HyperFrames seeking
- Seek animations deterministically using goToAndStop() or frame/percentage APIs
- Support multiple animations synchronized to the same composition timeline
- Keep animation containers stable with CSS sizing
How to install lottie
npx skills add https://github.com/heygen-com/hyperframes --skill lottie- HyperFrames project set up
- Lottie animation files (JSON or .lottie) in assets/ directory
- lottie-web or @lottiefiles/dotlottie-web library loaded in HTML
How to use lottie
- 1.Place your Lottie JSON or .lottie files in the assets/ directory
- 2.Load lottie-web or dotLottie library via CDN or script tag
- 3.Create a container element (div for lottie-web, canvas for dotLottie)
- 4.Initialize the player with autoplay: false and loop: false
- 5.Register the animation instance on window.__hfLottie array
- 6.Style the container with stable width/height using CSS
- 7.Run npx hyperframes lint and npx hyperframes validate to verify
Use cases
- Logo reveals and icon animations in product demos
- Decorative motion accents and UI transitions
- Converting Remotion Lottie usage to plain HyperFrames HTML
- After Effects exports that render correctly in lottie-web
- Synchronized multi-animation sequences in video compositions
- Motion designers exporting from After Effects
- Frontend developers embedding Lottie animations
- Video composition creators using HyperFrames
- Teams translating Remotion projects to HyperFrames
lottie FAQ
Use lottie-web for JSON animations exported from After Effects. Use dotLottie for .lottie files, which are more optimized and support advanced features. Both work with HyperFrames seeking.
Yes. Push each player into the same window.__hfLottie array, and HyperFrames will seek them all to the same timeline position.
Only effects that lottie-web can render. Test your JSON or .lottie file in a browser first to confirm compatibility before using in HyperFrames.
No. Load animations from local project files in the assets/ directory to ensure deterministic rendering at composition time.
Run npx hyperframes lint and npx hyperframes validate after editing your composition to check for registration and loading errors.
Full instructions (SKILL.md)
Source of truth, from heygen-com/hyperframes.
name: lottie description: Lottie and dotLottie adapter patterns for HyperFrames. Use when embedding lottie-web JSON animations, .lottie files, @lottiefiles/dotlottie-web players, registering instances on window.__hfLottie, or making After Effects exports deterministic in HyperFrames.
Lottie for HyperFrames
HyperFrames can seek both lottie-web and dotLottie players through its lottie runtime adapter. Lottie is a strong fit because the animation timeline is already encoded in the asset; HyperFrames only needs a player object it can seek.
Contract
- Load assets from local project files, usually under
assets/. - Set
autoplay: false. - Prefer
loop: falseunless the user explicitly wants a loop. - Register every returned animation or player on
window.__hfLottie. - Keep the Lottie container dimensions stable with CSS.
The adapter seeks lottie-web with goToAndStop(timeMs, false) and dotLottie with frame or percentage APIs depending on player shape.
lottie-web Pattern
<div id="logo-lottie" class="lottie-layer"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.12.2/lottie.min.js"></script>
<script>
const anim = lottie.loadAnimation({
container: document.getElementById("logo-lottie"),
renderer: "svg",
loop: false,
autoplay: false,
path: "assets/logo-reveal.json",
});
window.__hfLottie = window.__hfLottie || [];
window.__hfLottie.push(anim);
</script>
.lottie-layer {
width: 100%;
height: 100%;
}
dotLottie Pattern
<canvas id="product-lottie" class="lottie-canvas"></canvas>
<script src="https://unpkg.com/@lottiefiles/dotlottie-web"></script>
<script>
const player = new DotLottie({
canvas: document.getElementById("product-lottie"),
src: "assets/product-flow.lottie",
autoplay: false,
loop: false,
});
window.__hfLottie = window.__hfLottie || [];
window.__hfLottie.push(player);
</script>
.lottie-canvas {
width: 100%;
height: 100%;
display: block;
}
Multiple Animations
Push each player into the same registry:
window.__hfLottie = window.__hfLottie || [];
window.__hfLottie.push(backgroundAnim);
window.__hfLottie.push(iconAnim);
window.__hfLottie.push(confettiAnim);
HyperFrames seeks them all to the same composition time.
Good Uses
- After Effects exports that are already known to render correctly in lottie-web.
- Logo reveals, icon loops, decorative accents, and product UI motion.
- Translating Remotion Lottie usage into plain HyperFrames HTML.
Avoid
- Relying on remote
pathURLs at render time. - Starting playback with
play(). - Assuming unsupported After Effects effects will survive export. Test the JSON or
.lottiefile in a browser first. - Loading a player asynchronously and registering it after HyperFrames validation has already inspected the page.
Validation
After editing a Lottie composition:
npx hyperframes lint
npx hyperframes validate
Credits And References
- HyperFrames adapter source:
packages/core/src/runtime/adapters/lottie.ts. - lottie-web by Airbnb: https://github.com/airbnb/lottie-web
- lottie-web
loadAnimationoptions: https://github.com/airbnb/lottie-web/wiki/loadAnimation-options - dotLottie web player methods by LottieFiles: https://developers.lottiefiles.com/docs/dotlottie-player/dotlottie-web/methods
Related skills
More from heygen-com/hyperframes and the wider catalog.
hyperframes
Router and entry skill for video authoring—renders video from HTML with intent-based workflow selection.
hyperframes-cli
CLI for HyperFrames video composition: scaffold, lint, validate, render locally or on AWS Lambda.
hyperframes-registry
Install and wire reusable blocks and components into HyperFrames compositions via registry.
remotion-to-hyperframes
Port existing Remotion (React) video compositions to HyperFrames HTML—one-way translation only.
hyperframes-media
Audio and media engine for HyperFrames: TTS, background music, sound effects, transcription, captions, and background removal.
gsap
GSAP animation reference for HyperFrames compositions with timelines, easing, and performance optimization.