Drop in a Lottie, set the size, loop, autoplay and speed you want, and copy the embed code for whichever player you are using — the current dotLottie web component, plain lottie-web, React or Vue. The preview uses lottie-web's SVG renderer, which is what most of these embeds run on, so what you see is what the page will show. The snippets get the details right that hand-written embeds usually miss: boolean attributes are omitted when off rather than written as loop="false" (which turns looping on, because HTML only checks whether the attribute is present), anything going into an attribute is escaped, and CDN references are pinned to a version rather than to latest, which is an unannounced auto-upgrade of third-party code running on your site.
| Player | Status | Use when |
|---|---|---|
| dotlottie-wc | Current | A new page, or you need .lottie support |
| lottie-web | Current | No custom element, smallest surface |
| lottie-player | Deprecated | A page that already loads it |
| React / Vue | Current | Inside a component tree |
The dotLottie web component for a new page — it is LottieFiles' current one and handles both .json and .lottie. Plain lottie-web if you would rather not register a custom element and want the smallest surface. The older lottie-player is deprecated; it is offered here only for a page that already loads it.
Because HTML boolean attributes are read by presence, not value. Writing loop="false" sets the attribute, so the player loops. The only way to turn it off is to leave the attribute out entirely, which is what these snippets do.
Because @latest means third-party JavaScript on your site silently upgrades itself whenever the maintainer publishes. Pinning is the difference between a page that keeps working and one that breaks on a morning you did nothing.
For a small one, it can be worth it — no second request and nothing to 404. Base64 adds about a third to the size, so a 400KB animation becomes a 530KB line of HTML, which is rarely a good trade in a template. The size is shown before you copy.
Yes, and generally you should. Put the .json or .lottie on your own domain and point src at it — an external URL is a third party who can change or remove your animation, and may be blocked by a content security policy.
No. It is previewed in your browser, and the snippet is built from your settings as text.
Usually one of three things: the src path is wrong relative to the page, the player script did not load, or the file is served from another origin without CORS headers. The browser console names which one.
The preview runs on lottie-web's SVG renderer, so what you see is the renderer most of these embeds will actually use rather than an approximation of it. The snippets are written out per player rather than generated from one template, because the players genuinely differ in shape and a shared template would be shorter and wrong: the web components take HTML attributes, lottie-web takes a configuration object and a separate setSpeed call, and the React and Vue packages take props whose names do not match the attributes at all. Boolean attributes are emitted as bare attributes and omitted entirely when false, which is how HTML boolean attributes work — writing loop="false" turns looping on, because the presence of the attribute is what counts and its value is ignored. That single detail is the most common bug in hand-written Lottie embeds. Anything interpolated into an attribute is escaped, so a URL containing a quote cannot close the attribute and inject markup into the page the snippet is pasted onto. The player list reflects where things actually stand rather than where they stood: LottieFiles has deprecated both lottie-player and dotlottie-player in favour of dotlottie-wc, so that is the default and the older component is offered with the deprecation stated in the snippet itself, for the case where an existing page already loads it. CDN references are pinned to a version rather than to latest, because latest is a silent auto-upgrade of third-party code executing on your site. The inline option base64s the animation into a data URI for a single-file embed with no separate request, with the resulting size shown first — base64 adds a third, and a 400KB animation becomes a 530KB line of HTML, which is worth knowing before pasting it into a template.