EmptyState
SM, under 950B gzippedA placeholder for a list, table, or panel with nothing in it yet.
- Category
- Feedback & status
- Budget
- sm, single-purpose control
- Runtime deps
- None
Preview
No results
Try a different search.
This is the exact fixture the conformance suite renders in CI. Switch the language to see the component mirror and reformat.
Install
npx shadcn@latest add https://kata-ui-rho.vercel.app/r/empty-state.jsonCopies the source into your project. Pulls in 1 primitive: cn.
Source
import { cn } from "../lib/cn";
export interface EmptyStateProps {
title: string;
description?: string;
action?: React.ReactNode;
icon?: React.ReactNode;
className?: string;
}
/** A placeholder for a list, table, or panel with nothing in it yet. */
export function EmptyState({ title, description, action, icon, className }: EmptyStateProps) {
return (
<div
className={cn(
"flex flex-col items-center gap-2 rounded-lg border border-dashed border-neutral-300 p-10 text-center dark:border-neutral-700",
className,
)}
>
{icon && (
<div aria-hidden="true" className="mb-1 text-neutral-400 dark:text-neutral-600">
{icon}
</div>
)}
<p className="font-medium">{title}</p>
{description && <p className="max-w-sm text-sm text-neutral-600 dark:text-neutral-400">{description}</p>}
{action && <div className="mt-2">{action}</div>}
</div>
);
}
What CI checks
- Bundled, minified and gzipped against its tier budget
- Audited by axe in the state previewed above
- Rendered through react-dom/server with no browser globals
- Scanned for network calls, dangerous sinks, and unguarded animation