Empty State

Empty layouts for placeholders, search results, and errors, with basic, action, illustration, and avatar variants.

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>
}
/>
);
}

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.