dotLottie Grid Notes
LottieFiles' WebAssembly-powered player for `.lottie` archives and Lottie JSON animations, with official wrappers for React, Vue, Svelte and plain web canvas.
Install and prerequisites
npm install @lottiefiles/dotlottie-react@lottiefiles/dotlottie-react@lottiefiles/dotlottie-webRequires React 16.8+ for @lottiefiles/dotlottie-react. The player renders into a <canvas> via a WebAssembly core.
Framework setup
Client-only React player with pause and reduced-motion control
Keep DotLottieReact in a client component, check prefers-reduced-motion, and capture dotLottieRefCallback so users can pause looping animations.
"use client";
import { useState } from "react";
import { DotLottieReact, type DotLottie } from "@lottiefiles/dotlottie-react";
export function LottieFigure({ src, label }: { src: string; label: string }) {
const [player, setPlayer] = useState<DotLottie | null>(null);
const [paused, setPaused] = useState(false);
const toggle = () => {
if (!player) return;
if (paused) player.play();
else player.pause();
setPaused(!paused);
};
return (
<figure aria-label={label} className="relative">
<DotLottieReact src={src} loop autoplay dotLottieRefCallback={setPlayer} />
<button type="button" onClick={toggle} className="text-xs underline">
{paused ? "Play animation" : "Pause animation"}
</button>
</figure>
);
}Gotchas for agents
WebAssembly loading and CSP
@lottiefiles/dotlottie-webloads a.wasmbinary at runtime. If your Content Security Policy restrictsconnect-srcorwasm-unsafe-eval, host the WASM file locally and configureDotLottie.setWasmUrl('/dotlottie-player.wasm')before mounting.SSR and Next.js hydration
DotLottieReactuses browser<canvas>andOffscreenCanvasAPIs. Always mark wrapper components with"use client"and give the container explicit dimensions (aspect-ratioor fixed height) so the page does not shift (CLS) when the.lottiefile finishes loading.Prefer .lottie over raw JSON
.lottiearchives bundle and compress animations, images and state machines into a fraction of the size of raw Lottie.jsonfiles.
Accessibility and reduced motion
Reduced motion
Check window.matchMedia('(prefers-reduced-motion: reduce)').matches before setting autoplay={true}; when reduced motion is active, pass autoplay={false} and render a static representative frame.
Keyboard and screen readers
Because DotLottieReact renders to a <canvas>, screen readers see no internal text. Mark purely decorative animations aria-hidden="true", or wrap informative ones in <figure role="img" aria-label="..."> and provide a visible Pause button for any loop over 5 seconds.
More Grid Notes
- LenisLightweight smooth-scroll engine that keeps native browser scrolling, sticky positioning and intersection observers intact, and pairs cleanly with GSAP ScrollTrigger.
- GSAPTimeline, scroll-linked and text-splitting animation engine. All plugins — including ScrollTrigger, SplitText and MorphSVG — are included under Webflow's no-charge licence.
- MotionMIT-licensed animation library for React and JavaScript (formerly Framer Motion), offering a 3.3 kB `motion/mini` WAAPI build as well as layout, gesture and spring animations.
- NumberFlowDependency-free animated number component for React, Vue and Svelte that rolls individual digits into place and formats values with `Intl.NumberFormat`.
- RiveInteractive state-machine graphics packaged in compact `.riv` files and driven at 60–120 fps by Rive's open-source WebGL2 and Canvas runtimes.
- Theatre.jsKeyframe timeline engine and visual studio overlay for choreographing Three.js / React Three Fiber cameras, lights and DOM properties.



