Banner Section
Top or inline announcement banner with 6 variants, optional CTA, and dismiss button
Quick Preview
๐ New features just dropped โ see what's new!
โน๏ธ Scheduled maintenance on June 1, 02:00โ04:00 UTC.
โ Your plan has been upgraded to Pro.
โ ๏ธ Your trial expires in 3 days. Upgrade to keep access.
๐ด Critical update required โ please reload your app.
โจ We're hiring โ join our team and build the future.
Installation
// Copy the component fromsrc/components/sections/BannerSection.tsx
Usage
import { BannerSection } from '@/components/sections/BannerSection'// Inline announcement<BannerSectionmessage="๐ New features just dropped! Check out our latest release."ctaLabel="See what's new"ctaHref="/changelog"variant="primary"/>// Sticky top banner<BannerSectionmessage="Maintenance window: May 30 from 2โ4 AM UTC."variant="warning"position="top"icon="โ ๏ธ"/>
Dismissible
๐ Get 20% off your first year with code LAUNCH20
Claim offerPrompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
message* | string | - | Banner message text |
ctaLabel | string | - | Call-to-action button label |
ctaHref | string | - | Call-to-action link href |
variant | "primary" | "info" | "success" | "warning" | "danger" | "dark" | "primary" | Color scheme |
position | "top" | "inline" | "inline" | Sticky top or inline placement |
dismissible | boolean | false | Show dismiss (ร) button |
onDismiss | () => void | - | Dismiss button callback |
icon | string | - | Emoji or text icon displayed left of message |
className | string | - | Additional CSS classes |
Features
- โ6 color variants
- โSticky top or inline position
- โOptional dismiss button
- โOptional CTA link
- โEmoji icon support
- โServer Component (dismissible needs Client wrapper)