webdevpuneet.com

Lottie Success Checkmark Loader — Free HTML CSS JS Snippet

Lottie Success Checkmark Loader · Loaders · Plain HTML, CSS & JS · Live preview

CategoryLoaders

Copy & paste

Source Code

Requires
<div class="lsc-card">
  <div class="lsc-stage">
    <div class="lsc-lottie" id="lscLottie"></div>
    <div class="lsc-checkmark" id="lscCheckmark">
      <svg width="46" height="46" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
        <path d="M5 13l4 4L19 7" />
      </svg>
    </div>
  </div>
  <div class="lsc-status" id="lscStatus">Processing…</div>
  <button class="lsc-btn" id="lscRestart" type="button">Run again</button>
</div>

Extend with AI

Take This Snippet Further With AI

The AI prompt for this one is for Patreon supporters ($3 a month, 7 days free), along with a site with no ads. Supporters enter the passcode once and it is remembered in this browser.

· Become a supporter

What's included

Features

Loads the real lottie-web library from a CDN via cdnUrls
Inline animationData JSON object — no external .json file fetched
lottie.loadAnimation() with SVG renderer, looping while "processing"
Clean handoff from the Lottie animation to a static CSS checkmark
Spring-style CSS scale transition on the success checkmark reveal
Restart button replays the full sequence, destroying old instances first
Self-contained — no image or font assets required
Dark-theme card layout with a fixed-size animation stage

About this UI Snippet

Lottie Success Checkmark Loader — Animated Processing State With Checkmark Completion

Screenshot of the Lottie Success Checkmark Loader snippet rendered live

This snippet shows the common "processing then success" loading pattern using the real lottie-web library rather than a CSS spinner. A small pulsing circle animation plays while work is simulated, then smoothly hands off to a static green checkmark.

Loading the animation

The lottie-web UMD build is loaded from a CDN via cdnUrls, exposing a global lottie object. runSequence() calls lottie.loadAnimation({ container, renderer: 'svg', loop: true, autoplay: true, animationData }) against an inline animation JSON object — no external .json file is fetched, keeping the snippet fully self-contained.

The handoff to success

After roughly two seconds, lottieInstance.stop() halts the Lottie player, the Lottie container is hidden, and a plain SVG checkmark inside a green circle is revealed with a spring-like CSS scale transition — a lightweight way to combine a vector animation library with a simple CSS-driven completion state.

Restartable

The "Run again" button calls the same runSequence() function, which destroys the previous Lottie instance before creating a fresh one, so the whole processing-to-success cycle can be replayed without leaking animation instances.

Step by step

How to Use

  1. 1
    Load the snippetClick "Lottie Success Checkmark Loader" in the sidebar to load its HTML, CSS, and JS into the editor panels. The preview updates instantly.
  2. 2
    Edit the codeModify any panel — HTML, CSS, or JS. The preview refreshes as you type. Use Reset in each panel header to restore the original.
  3. 3
    Preview on devicesClick the Mobile (375px), Tablet (768px), or Desktop buttons in the preview header to check responsiveness.
  4. 4
    Export in your formatClick "HTML" to download a standalone file, "JSX" for a React component, "Tailwind" for a React + Tailwind CSS component, "Tailwind HTML" for a standalone HTML file with Tailwind CDN, "Vue" for a Vue 3 SFC with <template>/<script setup>/<style scoped>, or "Angular" for a standalone Angular .component.ts file. "Copy all" copies the full code to clipboard.
  5. 5
    Save your versionClick "Save as", type a name, and press Enter. Your snippet saves to IndexedDB and appears in the Saved tab.

Real-world uses

Common Use Cases

📨
Form submission feedback
Show a pulsing Lottie animation while a request runs, then hand off to a static checkmark on success.
📤
File upload confirmation
Play the processing sequence while a file transfers, ending on a clear completed state that does not keep animating.
✅
Onboarding completion steps
Confirm that a setup step has finished, using inline animationData so no external JSON file needs to be fetched.
🎓
lottie-web integration reference
See lottie.loadAnimation() with the SVG renderer looping while processing, and how stopping it cleanly makes room for the final state.

Got questions?

Frequently Asked Questions

No. The animationData object is defined inline in the JavaScript, so the snippet is fully self-contained aside from loading the lottie-web library itself.

A setTimeout simulates completed work; in a real app you would call lottieInstance.stop() and swap to the checkmark inside your actual success callback instead of a fixed delay.

Yes — clone the pattern used for the checkmark, swapping in a red circle and an X icon, and branch the timeout callback based on your real success/failure result.