Skip to content
Component installs need the registry setup
VegaStack Design

Announcement Banner

A dismissible one-line announcement — the full-width inverse page-top band.

Status
stable
Since
0.3.0
Accessibility pattern
ARIA status region (opt-in)

Last updated

Workflows now orchestrate revenue agents.Read more

Install

Configure registry credentials first using the Quickstart. Before copying this item or any transitive registry dependency, verify the signed manifest and save the exact bytes for Announcement Banner before installation. Retain the digest printed by this command.

pnpm exec vegastack-design verify announcement-banner

Install with the pinned shadcn CLI. Bare shadcn does not verify VegaStack signature or integrity.

pnpm dlx shadcn@4.21.0 add @vegastack/announcement-banner

Run the exact offline --post-write command printed by the preflight, using its saved item path and independently retained --expected-integrity digest. Use the saved preflight for every transitive registry dependency too; stop on any mismatch before using the components.

The same command installs the registry items it composes: @vegastack/button.

Usage

<AnnouncementBanner dismissable action={<a href="/changelog">Read more</a>}>
  Workflows now orchestrate revenue agents.
</AnnouncementBanner>

When to use

AnnouncementBanner is the one full-width inverse strip that spans the top of a page (foreground fill, on-background text, centered copy). For an in-content notice or a plan/trial row, use Alert — a card-ground row with an icon, a title, a description and an action slot — rather than a second banner component.

Live announcements

A page-top band that exists at load is chrome, so it carries no live role — announcing it would compete with the page's own heading for the first thing a screen reader user hears. Pass live only for a banner that mounts (or re-words) after the page has settled; it then becomes a polite role="status" region.

Examples

Workflows now orchestrate revenue agents.Read more

Dismissal

Uncontrolled by default (the banner removes itself). Pass onDismiss to own it — persist the choice and stop rendering; the button then only notifies.

API Reference

PropTypeDefaultDescription
actionReact.ReactNode—Action slot rendered after the message (a link or small Button).
dismissablebooleanfalseShow the dismiss button; the banner removes itself unless onDismiss is given (controlled dismissal — persist it and stop rendering the banner).
dismissLabelstring'Dismiss announcement'Accessible name for the dismiss control.
livebooleanfalseMark this strip as a runtime announcement — mounted (or re-worded) after the page settled. Only then does it become a polite role="status" live region. The default is deliberately NO live role: a page-top band that is in the DOM at load is chrome, and announcing it competes with the page's own heading for the first thing a screen reader user hears (D23).
onDismiss(() => void)—Called when dismissal is controlled by the host.

Data attributes and CSS variables on AnnouncementBanner

AttributeValues
data-live""
data-slot"announcement-banner" | "announcement-banner-action" | "announcement-banner-dismiss"

Accessibility

  • The banner carries no live role at load. With live it is a polite status region, so keep its message brief and avoid continuously changing content.
  • The dismiss control has a caller-overridable accessible name and a minimum 24px hit area.
  • A composed action must keep visible link or button text; dismissal is never the only way to continue.
KeyAction
TabMove to the optional action and dismiss control.
Enter / SpaceActivate the focused button.
ContractStates tested
Behaviourdefault, open
Accessibilitylabeled, status-announcement, semantic-html
Visualdefault, hover

Do / Don't

Do
Announce one timely change and offer at most one direct follow-up action.
Don't
Use a banner for validation errors, multi-step forms, or content that needs an interruptive alert.

On this page