Empty State

A React empty state for blank dashboards, no results screens, and errors, with an icon, title, description, action buttons, and a footer slot.

Loading preview

Examples

Practical examples and common states for the same installable component.

Action

Includes a primary action button for recovery.

examples/empty-state-action.tsx
"use client";
import { EmptyState } from "@/components/wensity/empty-state";
import { IconPlus } from "@tabler/icons-react";
export function ActionEmptyState() {
return (
<EmptyState
icon={<IconPlus />}
title="No API tokens"
description="Create a token to authenticate with the Wensity CLI."
action={
<button type="button">
<IconPlus />
New token
</button>
}
/>
);
}

Illustration

Larger visual container for expressive empty states.

examples/empty-state-illustration.tsx
"use client";
import {
EmptyState,
EmptyStateIllustration,
} from "@/components/wensity/empty-state";
import { IconFileOff } from "@tabler/icons-react";
export function IllustrationEmptyState() {
return (
<EmptyState
icon={
<EmptyStateIllustration>
<IconFileOff />
</EmptyStateIllustration>
}
title="No files uploaded"
description="Drag and drop assets or browse from your device."
/>
);
}

Avatar

Black and white profile image for personal empty states.

examples/empty-state-avatar.tsx
"use client";
import { EmptyState } from "@/components/wensity/empty-state";
export function AvatarEmptyState() {
return (
<EmptyState
icon={
<div className="overflow-hidden rounded-full border-2">
<img
src="https://assets.wensity.com/avatars/1.webp"
alt=""
className="grayscale"
/>
</div>
}
title="No activity yet"
description="Parth has not pushed any commits this week."
/>
);
}

Error

Displays failed or unavailable content with a retry action.

examples/empty-state-error.tsx
"use client";
import { EmptyState } from "@/components/wensity/empty-state";
import { IconRefresh, IconServerOff } from "@tabler/icons-react";
export function ErrorEmptyState() {
return (
<EmptyState
icon={
<div className="rounded-full bg-red-500/10 text-red-500 dark:bg-red-500/15 dark:text-red-400">
<IconServerOff />
</div>
}
title="Failed to load workspace"
description="The server returned an unexpected error. Try again."
action={
<button type="button">
<IconRefresh />
Retry
</button>
}
/>
);
}

Overview

Empty State is a React and Tailwind CSS empty state component, in Next.js or any React app, for blank dashboards, zero search results, and error pages. It centers an icon, a title, a short description capped at a readable width, an action slot for one or more buttons or a search field, and a footer for secondary links. The icon pops in on a light spring, skipped under reduced motion, and EmptyStateIllustration frames it in a bordered tile. The title renders as a paragraph rather than a heading, so keep a real heading on the page above it.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add empty-state

Usage

Import EmptyState from @/components/wensity/empty-state and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
// The example icons come from @tabler/icons-react: npm i @tabler/icons-react
import {
EmptyState,
EmptyStateIllustration,
} from "@/components/wensity/empty-state";
import { IconFolderOpen } from "@tabler/icons-react";
export function EmptyStateDemo() {
return (
<EmptyState
icon={<IconFolderOpen />}
title="No projects yet"
description="Create your first project to start organizing components."
/>
);
}

Props

PropTypeDefaultDescription
titlestring-Primary heading. Required.
descriptionstring-Supporting copy beneath the title.
iconReact.ReactNode-Large icon or illustration above the text.
actionReact.ReactNode-Primary action slot. Takes a button, a button group, or an input.
footerReact.ReactNode-Secondary slot below the action, for links or fine print.
  • File Uploader component preview

    File Uploader

    A bold red dropzone for any file, with gallery tiles and progress after upload.

  • Animated Loading Skeleton component preview

    Animated Loading Skeleton

    An organic loading state instead of a spinner, with a slow aurora that breathes in the space where your content will land.

  • Globe Card component preview

    Globe Card

    A dark icon card holding a dotted globe that slowly spins on its own axis.

  • Glass Capsule Stack component preview

    Glass Capsule Stack

    A frosted glass tube that stacks feature chips and drops the oldest into a card.