Banner
A page-level notice with an action, dismissible. The state always comes with a word.
import { Banner } from "@forgeron/ui";import { Banner, Button } from "@forgeron/ui";
export default function Tones() {
return (
<div style={{ display: "grid", gap: 8 }}>
<Banner title="Scheduled maintenance" dismissible>
Saturday 21 November, 02:00 to 03:00 CET.
</Banner>
<Banner
tone="warning"
title="Your trial ends in 3 days."
action={<Button size="sm">Choose a plan</Button>}
/>
<Banner
tone="danger"
title="Payment failed."
action={
<Button size="sm" variant="danger">
Update card
</Button>
}
>
We will retry tomorrow.
</Banner>
<Banner tone="success" title="Workspace restored." dismissible />
</div>
);
}API → Props
| Prop | Type | Default | Description |
|---|---|---|---|
tone | "info" | "success" | "warning" | "danger" | "info" | Warning and danger are announced at once. |
title | ReactNode | — | The short line. |
children | ReactNode | — | The detail. |
action | ReactNode | — | A button or link: the next thing to do. |
dismissible | boolean | — | Shows a dismiss button. |
open / defaultOpen / onOpenChange | boolean / boolean / (open) => void | true | Controlled or not. |
onDismiss | () => void | — | Hears the dismissal. |
className | string | — | Extra classes. |