AnnouncementBar
Dismissible announcement bar with optional action, tone and sticky positioning.
Design intent
Launches, content hubs and network notices need a thin bar above the header. AnnouncementBar owns the message, action and dismissal without forcing the site header to grow more props.
npx @slipstream-ui/cli@latest add announcement-barThe 2026 Middle Market Review is live
Read itSticky launch banner
See what is newMaintenance Sunday 02:00 UTC
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| message | ReactNode | required | Message shown in the bar. |
| href | string | — | Optional destination for the action. |
| actionLabel | string | — | Action text, shown when href is provided. |
| dismissible | boolean | true | Show a close control. |
| onDismiss | () => void | — | Called after dismissal. |
| tone | 'muted' | 'brand' | 'inverse' | 'muted' | Surface treatment. |
| sticky | boolean | false | Pin the bar to the top. |
| linkComponent | React.ElementType | — | Custom link element for routers. |
| linkHrefProp | 'href' | 'to' | 'href' | Prop name used to pass the destination to linkComponent. |
Anti-patterns
validate_usage is the MCP tool that rejects these mistakes: the same list agents see over MCP and in the canonical markdown.
Don't stack multiple announcements
One bar per page. Multiple messages compete and push the header down.
tsx// Avoid<AnnouncementBar message="A" /><AnnouncementBar message="B" />
Accessibility
- Renders a named region (Announcement) with a keyboard-operable dismiss button.
- The caller owns persistence and dismissal policy.
Composition
Compose with SiteHeader: Place AnnouncementBar above the sticky header
<AnnouncementBar message="." /><SiteHeader ... />
Related components: SiteHeader, Alert
Dependencies
What the registry installs alongside this component. Package imports already include these.
npm packages
- class-variance-authority
- clsx
- tailwind-merge
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+: macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA, the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.