DotLottie
llms.txtExample
Usage
Renders a Lottie animation using the dotLottie web runtime (WASM + canvas). Unlike <Lottie>, this supports the Slots API — a first-class runtime theming system.
Accepts both .lottie and plain .json animations:
<DotLottie src="/my-anim.lottie" class="aspect-video max-w-xl" />
Theming with slots
The animation JSON must have properties tagged with sid values per the Lottie Slots spec . Then pass a slots prop mapping slot id → CSS color:
<DotLottie src="/my-anim.lottie" slots={{ Background: 'var(--color-base-100)', Primary: 'var(--color-accent-500)' }} />
Slots re-apply automatically when the theme changes or when the slots prop updates.
<Lottie> vs <DotLottie>
<Lottie>
- Runtime:
lottie-web(SVG) - Theming:
colorMap— replaces matching source colors anywhere in the file - Works on any existing animation
- Lighter bundle
<DotLottie>
- Runtime:
@lottiefiles/dotlottie-web(WASM + canvas) - Theming:
slots— requires the animation to be authored withsidmarkers - Heavier bundle (WASM renderer)
- Use when you control the animation and want reliable, name-based theming
API Reference
DotLottie
Lottie player using the dotLottie WASM runtime. Supports the Slots API for runtime theming. Lazy-loads the runtime on mount.
Property Type Description
src
string
URL to a .lottie or .json animation file. Default: —
data
string | ArrayBuffer | Record<string, unknown>
Animation data. Takes precedence over src. Default: —
loop
boolean
Whether to loop the animation. Default:
trueautoplay
boolean
Whether to start playing on mount. Default:
trueslots
object
Map of slot id → color. Animation must mark properties with `sid` values per the Lottie Slots spec. Values can be hex, rgb(), or var(--token). Default: —
Property
src
data
loop
autoplay
slots