Top Banner Notification
A dismissible full-width sticky banner for site-wide announcements with themed colour variants.
TopBannerNotification mounts a slim position: fixed strip at the very top of the viewport. It carries a status message on the left and an animated call-to-action button on the right. The component dismisses itself (sets internal visible state to false) when the user clicks the dismiss control.
Three built-in themes are provided via BootTheme: a dark terminal look (classicDark), a light mode (classicLight), and a green-on-black hacker palette (hacker).
SSR note — this component is
"use client"and usesposition: fixed, so mount it once near the root of your layout.
Installation
npx shadcn@latest add @adv/top-banner-notificationUsage
import TopBannerNotification from '@/components/ui/top-banner-notification';
// In app/layout.tsx or a root client component:
<TopBannerNotification theme="classicDark" />Example
Theme prop accepts: classicDark · classicLight · hacker
Props
| Prop | Type | Default | Description |
|---|---|---|---|
theme | "classicDark" | "classicLight" | "hacker" | "classicDark" | Colour palette applied to the banner background, text, and CTA button. |