ui-kit0.0

Signature

Announcement bar

A dismissible strip for news.

Variants

A strip across the top of the page. neutral for notices, primary for a launch, gradient-subtle for marketing moments. Dismiss one: it collapses and the content below glides up.

Scheduled maintenance on Sunday 30 November, 02:00–03:00 UTC.

Status page
New

Usage-based billing is live for every workspace.

Read the changelog

Northwind Live — 4 December, online and free.

Save your seat

When to use

  • Site-wide news: a launch, a pricing change, an event.
  • A planned maintenance window everyone should see before it happens.

Not for: feedback on something the user just did (use a toast), problems inside a form or section (use an alert), anything that must block the page (use a dialog). Show one bar at a time.

Remember the dismissal

storageKey stores the dismissal in localStorage. The server always renders the bar; after hydration a stored dismissal removes it at once, without animation. Use a new key for each announcement. This example is also controlled with open and onOpenChange.

New pricing starts on 1 January. Your plan keeps its price for 12 months.

See what changes

Dismiss it, then reload the page.

API

AnnouncementBar

PropTypeDefaultDescription
variant'neutral' | 'primary' | 'gradient-subtle''neutral'Surface.
openboolean—Controlled visibility.
defaultOpenbooleantrueInitial visibility when uncontrolled.
onOpenChange(open: boolean) => void—Called when the bar is dismissed (or hidden from storage).
dismissiblebooleantrueShow the × button.
dismissLabelstring'Dismiss announcement'Accessible name of the × button.
storageKeystring—Remember the dismissal in localStorage under this key.
iconReactNode—Leading icon or AnnouncementBarBadge.
actionReactNode—Usually an AnnouncementBarLink.
aria-labelstring'Announcement'Name of the region landmark.

AnnouncementBarLink

PropTypeDefaultDescription
asChildbooleanfalseRender your element (e.g. a Next.js Link) with the link styles and arrow.
arrowbooleantrueTrailing arrow that nudges on hover.
...propsAnchorHTMLAttributes—Forwarded to <a>.

AnnouncementBarBadge is a small pill (“New”, “Beta”) to pass as icon.

Keyboard

KeyAction
TabMoves to the link, then the × button.
Enter / SpaceActivates the focused link or dismisses the bar.

Accessibility

  • A region landmark named by aria-label, so screen-reader users can find or skip it. Give each bar on a page its own name.
  • The × is a real button with an accessible name; it has a 44px touch target without making the strip taller.
  • No role="alert": an announcement is part of the page, so it does not interrupt.

Motion

  • Dismiss: the height collapses (280ms) while the strip fades and lifts 4px with a light blur, so the page glides up instead of jumping.
  • Showing it again after load opens it on the smooth spring; the first render never animates.
  • The link arrow nudges 2px on hover (fine pointers only).
  • Reduced motion: the bar disappears without movement.