Skip to content

Empty state

Names what will appear and offers exactly one action.

30 lines · React · Tailwind 4

Install

$ bunx shadcn@latest add @blocco/empty-state

Code

blocks/free/empty-state.tsx30 lines
import { Button } from "@/registry/blocco/ui/button";
import { PageHeader, EmptyState as Empty } from "@/registry/blocco/ui/misc";
import { Plus } from "@/registry/blocco/ui/icons";
import { Kbd } from "@/registry/blocco/ui/kbd";

/** The first screen a new account meets: it names what will appear and offers one action. */
export default function EmptyState() {
  return (
    <section className="mx-auto max-w-4xl px-6 py-12">
      <PageHeader
        title="Links"
        action={
          <Button variant="primary">
            <Plus size={16} /> New link <Kbd tone="primary">C</Kbd>
          </Button>
        }
      />
      <Empty
        title="No links yet"
        hint="Your links, their clicks and where they came from appear here the moment you make the first one."
        action={
          <Button>
            <Plus size={16} /> Make your first link
          </Button>
        }
      />
    </section>
  );
}