lottie-react
Reference

The stylesheet contract

The class names, keyframes and custom properties a stylesheet can rely on.

import { Lottie } from "lottie-react";export function UtilityClasses() {  return (    <Lottie      src="/anim.json"      autoplay      loop      className="size-32 rounded-xl bg-blue-500/10 p-2 ring-2 ring-blue-500"    />  );}

Every identifier below is public: it survives updates within a major version, so a stylesheet anywhere can target it. All defaults sit at zero specificity inside one cascade layer, so your styles always win.

Class names

ClassOn
lottie-rootthe wrapper, when children are present
lottie-displaythe element the animation draws inside
lottie-controlsthe control bar
lottie-playthe play and pause button
lottie-stopthe stop button
lottie-seekthe seek bar
lottie-readoutthe position readout
lottie-loopthe loop button
lottie-directionthe direction button
lottie-speedthe speed select
lottie-fullscreenthe fullscreen button
lottie-loadingthe loading overlay
lottie-spinnerthe spinner inside it
lottie-errorthe error overlay

Keyframes

lottie-spin turns the spinner; lottie-loading-in fades the loading overlay in. Keyframes names are global to a document, which is why both carry the prefix.

Custom properties

--lottie-loading-delay (default 400ms) and --lottie-loading-fade (default 150ms) tune the loading overlay from CSS at any level.

Layer and precedence

The cascade layer is lottie-react, and the React style precedence is the same word. A layered consumer declares @layer lottie-react; first, per Installation.

On React 19 each sheet appears once, hoisted into <head> however many animations render. On React 18 every element carries its own copy in place: the same rules, applied the same way, just not deduplicated.

On this page