Skip to main content
Version: latest
Runtime

Lottie is client-only and always runs in the browser.

Lottie

Lottie lazy-renders a dotLottie animation via @lottiefiles/dotlottie-react. The animation only loads when the container scrolls into the viewport (IntersectionObserver), keeping off-screen frames from consuming resources.

Live demo →

Overview

import { Lottie } from "@prokodo/ui/lottie"
;<Lottie animation="/animations/hero.lottie" loop autoplay />

Import

import { Lottie } from "@prokodo/ui/lottie"

Available animations

All pre-defined animation URLs are exported from LottieAnimations.ts as the ANIMATIONS map:

import { ANIMATIONS } from "@prokodo/ui/lottie/LottieAnimations"
<Lottie animation={ANIMATIONS.SolutionCloud} />

Props

PropTypeDefaultRequiredDescription
animationobjectLottie animation JSON data.
loopbooleantrueLoop the animation.
autoplaybooleantrueAuto-start the animation.
containerClassNamestringCSS class on the animation container.
classNamestringCSS class on root element.

Additional props from DotLottieReactProps (e.g. speed, playOnHover) are forwarded to the underlying player. See src/components/lottie/Lottie.model.ts for the full type.


WCAG 2.2 Status

CriterionNameStatusNote
1.1.1Non-text Content (A)🔍 Manual reviewAll images, icons, and media require a text alternative (alt, aria-label, or aria-labelledby). Decorative-only elements must carry aria-hidden.
2.2.2Pause, Stop, Hide (A)🔍 Manual reviewAnimations or auto-rotating content lasting more than 5 s must provide a pause/stop control.
2.3.1Three Flashes or Below Threshold (A)🔍 Manual reviewAnimated content must not flash more than 3 times per second.
4.1.2Name, Role, Value (A)🔍 Manual reviewName, role, and state of all interactive UI components must be programmatically determinable via native HTML semantics or ARIA.

Test coverage: 1 jest-axe assertion(s) across 1 test file(s) · 0 ARIA attribute occurrence(s) in source scan. Criteria marked 🔍 require manual verification in the final product integration and theme context.

Storybook

👉 Open Lottie in Storybook


Source

src/components/lottie/Lottie.model.ts