webdevpuneet.com

Lottie Empty State Illustration — Free HTML CSS JS Snippet

Lottie Empty State Illustration · Cards · Plain HTML, CSS & JS · Live preview

CategoryCards

Copy & paste

Source Code

Requires
<div class="lei-card">
  <div class="lei-lottie" id="leiLottie"></div>
  <h3 class="lei-title">No items yet</h3>
  <p class="lei-desc">Items you create will show up here. Get started by adding your first one.</p>
  <button class="lei-btn" id="leiCreateBtn" type="button">Create your first item</button>
</div>

Extend with AI

Take This Snippet Further With AI

The AI prompt for this one is for Patreon supporters ($3 a month), 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
Looping SVG-rendered Lottie illustration as a decorative accent
Clear empty-state headline and one-sentence supporting copy
Primary call-to-action button with a brief loading feedback state
Self-contained — no image or font assets required
Compact card layout suitable for dropping into any list or dashboard
Dark-theme styling consistent with the rest of the snippet library

About this UI Snippet

Lottie Empty State Illustration — Animated Card for Zero-Content Screens

Screenshot of the Lottie Empty State Illustration snippet rendered live

Empty states are the first thing a new user or an emptied-out list shows, and a static icon often feels flat. This snippet replaces it with a small looping animation from the real lottie-web library, paired with a clear headline, supporting copy, and a call-to-action button.

The Lottie illustration

The lottie-web UMD script is loaded from a CDN via cdnUrls, and on load the snippet immediately calls lottie.loadAnimation({ container, renderer: 'svg', loop: true, autoplay: true, animationData }) against an inline animation JSON object, so the pulsing circle plays continuously as a lightweight decorative accent above the text — no external .json asset needed.

Copy and call to action

Below the animation, a bold headline ("No items yet") and a one-sentence explanation set expectations, followed by a primary button whose label makes the very next action unambiguous. The button includes a brief disabled "Opening editor…" state on click to simulate a real navigation transition.

Reusing the pattern

Swap the headline, description, and button label for any zero-content screen — empty inbox, empty search results, empty dashboard — and reuse the same Lottie loading code with a different animationData object for a different decorative motion.

Step by step

How to Use

  1. 1
    Load the snippetClick "Lottie Empty State Illustration" 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

📭
Empty lists and dashboards
Show this card when a table or tab has no data, using a looping illustration drawn from inline animationData so no extra file is loaded.
👋
New workspace onboarding
Welcome users into an empty project with a clear headline, supporting sentence and a call-to-action button that creates their first item.
🔍
Search with no results
Swap the copy to explain that a search returned nothing, keeping the decorative animation as a friendly accent beside the message.
🎓
lottie-web integration reference
Demonstrate loading a small animation with the SVG renderer from a CDN, looping it as a decorative element inside a card.

Got questions?

Frequently Asked Questions

No. The animationData object is embedded directly in the JavaScript, so aside from loading the lottie-web library, no additional network request is made for the animation itself.

Yes — export any animation from After Effects with the Bodymovin/Lottie plugin as JSON and pass it as the animationData object in place of the inline example.

A subtle looping animation draws the eye and signals that the empty area is intentional rather than broken, which a static icon cannot convey as effectively.