Loading component…
Loading component…
Notice cards stacked behind each other
To reuse this local React demo, copy all files from the Code tab into the same folder, then import NotificationStack from ./notification-stack.
import { NotificationStack } from "@/components/ui/notification-stack";
const notices = [
{
id: "maintenance",
badge: "Notice",
title: "Scheduled maintenance",
text: "We'll be offline on Sunday from 02:00 to 03:00 UTC.",
action: { label: "View status", href: "/status", external: true },
pattern: "grid",
},
];
export function Notices() {
return <NotificationStack notices={notices} onDismiss={(n) => markRead(n.id)} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| notices | Notice[] | id, badge, title, text, action ({ label, href, onClick, external }) and pattern | |
| onDismiss | (notice: Notice) => void | Called when a notice is dismissed with its close button | |
| className | string | Extra class on the stack |
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"
@import "tailwindcss"; in your main CSS file.