Empty State

Placeholder UI for empty data states with icons, descriptions, and call-to-action buttons.

Preview

Features

  • Large centered Phosphor icons in muted circular background
  • Customizable title and description text
  • Optional call-to-action button
  • Flexible className prop for custom styling
  • Dark mode support
  • Centered layout with responsive padding

Install Summary

This kit will add the following files and dependencies to your project. Download the bundle and extract it into your project root.

Component Files

FilePath
empty-state.tsxcomponents/onboarding/empty-state/empty-state.tsx
types.tscomponents/onboarding/empty-state/types.ts
index.tscomponents/onboarding/empty-state/index.ts

Utility Files

FilePath
design-tokens.tslib/design-tokens.ts

Dependencies

Install these dependencies before using the component:

Terminal
bash
npx shadcn@latest add button
Terminal
bash
npm install @phosphor-icons/react

Installation

Download the complete bundle as a ZIP file, or copy the text bundle to your clipboard:

Component Files

The component consists of the following files:

1. empty-state.tsx

empty-state.tsx
tsx
"use client";

import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import type { EmptyStateProps } from "./types";

2. types.ts

types.ts
tsx
import type { ComponentType } from "react";
import type { IconProps } from "@phosphor-icons/react";

type Icon = ComponentType<IconProps>;

export interface EmptyStateProps {
  icon: Icon;
  title: string;
  description: string;
  actionLabel?: string;
  onAction?: () => void;
  className?: string;
}

3. index.ts

index.ts
tsx
export { EmptyState } from "./empty-state";
export type { EmptyStateProps } from "./types";

Shared Utilities

This component uses shared utility functions. These are included in the bundle above:

design-tokens.ts

design-tokens.ts
tsx
// Border radius
export const radius = {
  card: "rounded-xl",
  badge: "rounded-full",
  button: "rounded-lg",

Usage

app/projects.tsx
tsx
import { EmptyState } from "@/components/onboarding/empty-state";
import { StarFour } from "@phosphor-icons/react";

function ProjectList() {
  const projects = [];

Props

PropTypeDefault
iconLucideIconrequired
titlestringrequired
descriptionstringrequired
actionLabelstring-
onAction() => void-
classNamestring-

Example Variants

VariantIconUse Case
No projectsFolderOpenEmpty project list
No documentsFileTextEmpty document library
No resultsSearchEmpty search results
No notificationsBellEmpty notification center