Node Header Status

PreviousNext

A React Flow component that displays status indicators in node headers.

Docs
simple-aiui

Preview

Loading preview…
./src/registry/ui/flow/node-header-status.tsx
import { Badge } from "@/components/ui/badge";
import { cn } from "@/lib/utils";

export const NodeHeaderStatus = ({
	status,
}: {
	status?: "idle" | "processing" | "success" | "error";
}) => {
	const statusColors = {
		idle: "bg-muted text-muted-foreground",
		processing: "bg-orange-500 text-white",
		success: "bg-green-500 text-white",
		error: "bg-red-500 text-white",
	};
	return (
		<Badge
			variant="secondary"
			className={cn("mr-2 font-normal", status && statusColors[status])}
		>
			{status ? status : "idle"}
		</Badge>
	);
};

NodeHeaderStatus.displayName = "NodeHeaderStatus";

Installation

npx shadcn@latest add @simple-ai/node-header-status

Usage

import { NodeHeaderStatus } from "@/components/ui/node-header-status"
<NodeHeaderStatus />