About
An inline, outlined banner for surfacing a status that needs user attention (like low disk space or an unreachable gateway) next to the affected content, with an optional status dot, dismiss button and action slot.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Status Banner to your project and fits it to your theme.
Code
How Status Banner is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import ZBanner from "@/components/ui/zbanner";
import { useState } from "react";
export default function ZBannerActionsDemo() {
const [retrying, setRetrying] = useState(false);
return (
<ZBanner
tone="danger"
dot
dismissible
onDismiss={() => setRetrying(false)}
title="网关不可达 · 10.0.0.4"
actions={
<button
type="button"
onClick={() => setRetrying(true)}
className="inline-flex h-6 items-center border border-black px-2 text-xs font-medium text-black transition-colors hover:bg-black hover:text-white"
>
重试
</button>
}
>
最近一次同步 14:02 失败,本地改动已保留。{retrying ? " 正在重试…" : ""}
</ZBanner>
);
}



