Skip to content
GetUrUI

Announcement Bars

5 variantsNewPro
.md

Five site-wide announcement bars — a rotating one-liner, an action card, a volt bar with email capture, a floating pill and a launch countdown with flipping digits — that slide in and collapse with a height spring when dismissed.

announcementbannerbarnoticecountdownlaunchemail capturedismiss

Slim

Newslim.tsx

One line with a tag and link. Several messages rotate with a blurred crossfade, a progress hairline and previous / next buttons.

$npx shadcn@latest add @geturui-pro/announcement-bars-slim
PropTypeDefaultDescription
messages{ tag?; text; href?; linkLabel? }[]—One or more messages.
intervalnumber6000Milliseconds per message when rotating.
dismissiblebooleantrueShows the dismiss button.
open / defaultOpenbooleantrueShown (controlled / uncontrolled).
onOpenChange(open: boolean) => void—Called with false when dismissed.
classNamestring—Classes for the outer element.

With actions

Newactions.tsx

Title, supporting line, secondary and primary buttons and a dismiss, as a contained card or full width; stacks on narrow screens.

$npx shadcn@latest add @geturui-pro/announcement-bars-actions
PropTypeDefaultDescription
title / descriptionstring—Bold lead and supporting text.
iconReactNode—Replaces the sparkle tile.
primaryLabel / onPrimarystring / () => void—Primary action.
secondaryLabel / onSecondarystring / () => void—Secondary action; empty string hides it.
width"contained" | "full""contained"Rounded card inside the page width, or edge to edge.
open / defaultOpenbooleantrueShown (controlled / uncontrolled).
onOpenChange(open: boolean) => void—Called with false when dismissed.
classNamestring—Classes for the outer element.

Brand

Newbrand.tsx

Full-width volt bar with inline email capture that validates, shows a spinner and swaps to a confirmation with a blur.

$npx shadcn@latest add @geturui-pro/announcement-bars-brand
PropTypeDefaultDescription
title / descriptionstring—Message copy.
placeholder / submitLabelstring—Field placeholder and button label.
onSubmit(email: string) => void | Promise<void>—Resolve to confirm; throw an Error to show its message.
open / defaultOpenbooleantrueShown (controlled / uncontrolled).
onOpenChange(open: boolean) => void—Called with false when dismissed.
classNamestring—Classes for the outer element.

Floating pill

Newfloating.tsx

A glass pill pinned to the bottom of the screen that springs up after a delay and drops away with a blur when dismissed.

$npx shadcn@latest add @geturui-pro/announcement-bars-floating
PropTypeDefaultDescription
tag / text / linkLabel / hrefstring—Chip, message and link.
onLinkClick() => void—Called when the link is used.
placement"fixed" | "absolute""fixed"Pin to the viewport or to the nearest positioned parent.
delaynumber400Milliseconds before it rises in.
open / defaultOpenbooleantrueShown (controlled / uncontrolled).
onOpenChange(open: boolean) => void—Called with false when dismissed.
classNamestring—Classes for the outer element.

Countdown

Newcountdown.tsx

Launch bar with days, hours, minutes and seconds that flip on springs, a reminder toggle and a live state at zero. Time is only read in effects.

$npx shadcn@latest add @geturui-pro/announcement-bars-countdown
PropTypeDefaultDescription
titlestring—Lead text before the timer.
targetstring | number—ISO date or epoch ms to count down to.
secondsnumber200478Counts down from mount when no target is given.
reminderLabel / onReminderChangestring / (on: boolean) => void—Reminder toggle (aria-pressed).
liveLabel / liveHrefstring—Link shown once the timer hits zero.
tone"default" | "brand""default"Brand tints the header volt with a faint grid and glow.
open / defaultOpenbooleantrueShown (controlled / uncontrolled).
onOpenChange(open: boolean) => void—Called with false when dismissed.
classNamestring—Classes for the outer element.

Install the whole set

Installs every announcement bars variant at once. Each section above has its own command for a single variant.

Pro installs use your private registry token. Add the @geturui-pro registry once — setup guide. The command works after you get Pro.

$npx shadcn@latest add @geturui-pro/announcement-bars

Also installs: Button

Accessibility

  • Every bar is a labelled region with a real dismiss button ("Dismiss announcement").
  • The rotator pauses on hover and focus, stops under reduced motion and only announces messages the user steps to.
  • Email capture has a hidden label, aria-invalid and an alert for errors; the countdown is a role=timer with a minute-level label.
  • Height, slide and digit springs become fades under reduced motion.

Related