Announcement barPro
A slim dismissible bar above the header that rotates launch messages.
$
pnpm dlx shadcn@latest add @lode/announcement-barLive preview
Message 1 of 2
When to use
- Launches, sales and maintenance windows above your header.
When not to use
- Errors in the app: use an alert.
Installation
$
pnpm dlx shadcn@latest add @lode/announcement-barPro components need an API key and the registry in components.json. See CLI and API keys.
1Install the dependencies
npm install motion lucide-react2Copy the source into your project
Usage
Import it from @/components/ui/announcement-bar after installing.
example.tsx
import { AnnouncementBar } from "@/components/ui/announcement-bar";
<AnnouncementBar storageKey="launch-2026" messages={[{ text: "40 new components.", href: "/changelog", cta: "See what's new" }]} />API reference
AnnouncementBar
A dismissible strip that rotates its messages.
messages
{ text; href?; cta? }[]
One or more messages.
badge= "New"
string
Label before the text.
storageKey
string
Remember dismissal in localStorage.
interval= 4500
number
ms per message.
tone= "dark"
"brand" | "neutral" | "dark"
Colors.
| Prop | Type | Default | Description |
|---|---|---|---|
| messages | { text; href?; cta? }[] | – | One or more messages. |
| badge | string | "New" | Label before the text. |
| storageKey | string | – | Remember dismissal in localStorage. |
| interval | number | 4500 | ms per message. |
| tone | "brand" | "neutral" | "dark" | "dark" | Colors. |
Keyboard interactions
| Keys | Action |
|---|---|
| Tab | Reach the link and dismiss button |
Accessibility
- A labelled region; rotation pauses on hover and focus.
- The dismiss button is labelled.
Motion
- Messages slide up through the bar; dismissing collapses its height.
Responsive behavior
- Text wraps and centers on phones.
Performance
- One interval while there are several messages.
Notes for AI
- Change storageKey for each new announcement so it shows again.
This page as Markdown, for assistants and coding agents:
/components/announcement-bar/markdownThe full library index for assistants is at /llms.txt.
Related
AlertComponentInline alerts and page banners in four tones, with actions and dismiss.MarqueeProComponentEndless, seamless scroller for logos and testimonials that glides to a stop on hover.Hero sectionProBlockLaunch hero with badge, flowing gradient headline, two actions and a live product preview on a glowing grid.
Lode·229 doc pages·llms.txt