A reusable generic empty state component for displaying when content is missing.
// Source: https://github.com/moira-mcp/moira | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import type { ReactNode } from "react";
import { PackageOpen } from "lucide-react";
import { LazyMotion, domAnimation, m } from "motion/react";
interface EmptyStateProps {
icon?: React.ComponentType<{ className?: string }>;
title: string;
description?: string;
action?: ReactNode;
}
export function EmptyState({
icon: Icon = PackageOpen,
title,
description,
action,
}: EmptyStateProps) {
return (
<LazyMotion features={domAnimation}>
<m.div
className="flex flex-col items-center justify-center gap-2 py-12"
initial={{ opacity: 0, y: 8 }}
ani
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key