Skip to Content

AnnouncementSection

Present announcements, promotions, countdowns, and multiple dismissible notices with accessible controls.

AnnouncementSection displays a concise notice with optional icon and consumer-provided action. It supports a single message, a countdown, or independently dismissible messages. It does not own campaign routing, persistence, or scheduling.

Beta API maturity: Beta.

Installation

import { AnnouncementSection } from "@puzzle-ui/pieces";

Variant previews

Every supported variant has an individual runnable preview. The dismiss control is keyboard operable; countdown mode requires a valid date string or Date.

bar - A compact notice at the top or bottom of a page.

390 × 844

dismissible - A temporary notice that visitors can close.

390 × 844

centered - A short, centered message with one clear action.

390 × 844

split - A message and action that need separate alignment.

390 × 844

promotional - A promotion with a prominent call to action.

390 × 844

countdown - A time-bound offer with a live countdown.

390 × 844

ticker - A long, scrollable strip of brief updates.

390 × 844

multi-message - Several independent notices in one region.

390 × 844

floating - A contained notice above surrounding content.

390 × 844

minimal - A low-emphasis message with minimal decoration.

390 × 844

API

PropTypeDescription
variant"bar" | "dismissible" | "centered" | "split" | "promotional" | "countdown" | "ticker" | "multi-message" | "floating" | "minimal"Selects the presentation. Defaults to bar.
messageReactNodeContent for a single announcement.
iconReactNodeOptional decorative icon for a single announcement.
actionReactNodeConsumer-provided action for a single announcement.
dismissiblebooleanEnables the dismiss button. Defaults to true for the dismissible variant.
dismissLabelstringAccessible name for the dismiss button.
countdownTargetDate | stringRequired with variant="countdown"; invalid dates throw a RangeError.
announcementsreadonly AnnouncementItem[]Required with variant="multi-message"; each item needs a stable id and message.
Shared section propsSectionRootProps and heading propsSemantic root, theme, native attributes, optional heading, actions, and children.

Usage

<AnnouncementSection
  variant="dismissible"
  message="A new collection is available."
  action={<a href="/collections">Explore the collection</a>}
/>

multi-message accepts icon, action, and dismissLabel per announcement item. Dismissed messages are removed for the current mounted instance; persistence is the consumer's responsibility. The ticker layout is horizontally scrollable and does not animate automatically.

Accessibility

Dismiss controls are real buttons with an accessible name and normal keyboard behavior. Use meaningful action text, keep notice content concise, and do not place essential information only in a decorative icon. A countdown is exposed as a time element; it is not announced every second.