robertlib

Empty State

Component

About

A placeholder block with an icon, heading, description and action buttons for empty lists, no search results, or first-run screens.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Empty State to your project and fits it to your theme.

Code

How Empty State is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import EmptyState from "@/components/ui/empty-state";
import { FileText, Upload } from "lucide-react";

export default function EmptyStateDemo() {
  return (
    <div className="w-full max-w-lg rounded-md border border-border bg-background">
      <EmptyState
        action={
          <>
            <button
              className="inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90"
              onClick={() => console.log("New invoice")}
              type="button"
            >
              New invoice
            </button>
            <button
              className="inline-flex h-9 items-center justify-center gap-2 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground"
              onClick={() => console.log("Import")}
              type="button"
            >
              <Upload className="size-4" />
              Import
            </button>
          </>
        }
        description="Create your first invoice, or import the ones you already have from a spreadsheet."
        icon={<FileText />}
        title="No invoices yet"
      />
    </div>
  );
}

Dependencies

More by robertlib

View all
  • Timeline

    Timeline

    1
  • Avatar

    Avatar

  • Collapsible Content

    Collapsible Content

  • Form Description

    Form Description

  • Chip

    Chip

  • Switch

    Switch

  • Form Error

    Form Error

  • Select

    Select