Lottie Empty State Illustration — Free HTML CSS JS Snippet

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

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.

Build with AI

Build, Understand, Optimize, and Extend It With AI

Hand this snippet's HTML, CSS, and JavaScript to an AI coding assistant like Claude and ask it to adapt "Lottie Empty State Illustration" to your project — restyle it to match your design system, wire it up to real data instead of the static example, or port it to the framework you're building in.

Prompt to recreate it

Copy this into your AI assistant of choice to build the effect from scratch, or as a jumping-off point for your own variant:

text
Build a cards component called "Lottie Empty State Illustration" using plain HTML, CSS, and vanilla JavaScript — no framework, no build step.

Requirements:
- Match the structure and behavior of the "Lottie Empty State Illustration" snippet from the UI Snippets Library.
- Keep the markup semantic and the styling self-contained (no external dependencies beyond what the original snippet uses).
- Keep the JavaScript vanilla, with no framework runtime required.
- Make it easy to restyle via CSS custom properties or class overrides so it can be dropped into a real project.

Want to tighten it up first? Run this prompt through the AI Prompt Studio to score it across 8 quality dimensions, catch anti-patterns, and tune the wording for Claude, ChatGPT, or Gemini before you paste it in.

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>

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 list and dashboard states
Show this card when a table, board, or feed has no items yet.
New workspace onboarding
Welcome users into an empty project space with a clear first action.
Search with no results
Swap the copy to explain a search returned nothing and suggest next steps.
lottie-web integration example
Demonstrates loading a small looping Lottie animation in vanilla JS.

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.