Announcement
The announcement component surfaces short, high-visibility messages without blocking the customer experience. Use announcement for promotions, loyalty updates, and lightweight prompts that keep customers engaged.
Announcements support links, optional dismissal, and can contain a modal for longer-form content. For persistent status messages or error alerts, use banner instead.
The announcement bar enforces a strict maximum height. Content beyond that height is truncated and can't scroll. Layout and content are controlled entirely through child elements.
Supported targets
- customer-account.
footer. render-after - customer-account.
order-index. announcement. render - customer-account.
order-index. block. render - customer-account.
order-status. announcement. render - customer-account.
order-status. block. render - customer-account.
order-status. cart-line-item. render-after - customer-account.
order-status. cart-line-list. render-after - customer-account.
order-status. customer-information. render-after - customer-account.
order-status. fulfillment-details. render-after - customer-account.
order-status. payment-details. render-after - customer-account.
order-status. return-details. render-after - customer-account.
order-status. unfulfilled-items. render-after - customer-account.
order. action. menu-item. render - customer-account.
order. action. render - customer-account.
order. page. render - customer-account.
page. render - customer-account.
profile. addresses. render-after - customer-account.
profile. announcement. render - customer-account.
profile. block. render - customer-account.
profile. company-details. render-after - customer-account.
profile. company-location-addresses. render-after - customer-account.
profile. company-location-payment. render-after - customer-account.
profile. company-location-staff. render-after - customer-account.
profile. payment. render-after
Supported targets
- customer-account.
footer. render-after - customer-account.
order-index. announcement. render - customer-account.
order-index. block. render - customer-account.
order-status. announcement. render - customer-account.
order-status. block. render - customer-account.
order-status. cart-line-item. render-after - customer-account.
order-status. cart-line-list. render-after - customer-account.
order-status. customer-information. render-after - customer-account.
order-status. fulfillment-details. render-after - customer-account.
order-status. payment-details. render-after - customer-account.
order-status. return-details. render-after - customer-account.
order-status. unfulfilled-items. render-after - customer-account.
order. action. menu-item. render - customer-account.
order. action. render - customer-account.
order. page. render - customer-account.
page. render - customer-account.
profile. addresses. render-after - customer-account.
profile. announcement. render - customer-account.
profile. block. render - customer-account.
profile. company-details. render-after - customer-account.
profile. company-location-addresses. render-after - customer-account.
profile. company-location-payment. render-after - customer-account.
profile. company-location-staff. render-after - customer-account.
profile. payment. render-after
Anchor to EventsEvents
The announcement component provides event callbacks for handling user interactions. Learn more about handling events.
- Anchor to aftertoggleaftertoggleaftertoggleCallbackEventListener<typeof tagName, ToggleArgumentsEvent>CallbackEventListener<typeof tagName, ToggleArgumentsEvent>
A callback that fires when the element state changes, after any toggle animations have finished.
- If the element transitioned from hidden to showing, the
property will be set toclosedand theproperty will be set toopen. - If the element transitioned from showing to hidden, the
property will be set toopenand thewill beclosed.
- If the element transitioned from hidden to showing, the
- Anchor to dismissdismissdismissCallbackEventListener<typeof tagName>CallbackEventListener<typeof tagName>
A callback that fires when the announcement is dismissed by the user clicking the close button or by calling the
dismiss()method programmatically.- Anchor to toggletoggletoggleCallbackEventListener<typeof tagName, ToggleArgumentsEvent>CallbackEventListener<typeof tagName, ToggleArgumentsEvent>
A callback that fires immediately when the element state changes, before any animations.
- If the element is transitioning from hidden to showing, the
property will be set toclosedand theproperty will be set toopen. - If the element is transitioning from showing to hidden, then the
property will be set toopenand thewill beclosed.
Learn more about the
toggleevent,property, andproperty.- If the element is transitioning from hidden to showing, the
CallbackEventListener
A typed event listener for custom element events. The listener receives a `CallbackEvent` with the correct `currentTarget` type for the associated custom element tag.
(EventListener & {
(event: CallbackEvent<TTagName, TEvent>): void;
}) | nullCallbackEvent
An event type that narrows the `currentTarget` to the specific HTML element associated with the custom element tag. This provides type-safe event handling in callback listeners.
TEvent & {
currentTarget: HTMLElementTagNameMap[TTagName];
}ToggleArgumentsEvent
The event data provided to toggle-related callbacks. Contains the previous and next visibility states of the element.
- newState
The visibility state of the element after the toggle occurred.
ToggleState - oldState
The visibility state of the element before the toggle occurred.
ToggleState
ToggleState
The visibility state of a toggleable element. - `open`: The element is visible and showing its content. - `closed`: The element is hidden and its content is not visible.
'open' | 'closed'Anchor to MethodsMethods
The announcement component exposes methods for programmatic control.
- Anchor to dismissdismissdismiss() => void() => voidrequiredrequired
Programmatically dismisses the announcement. This triggers the
dismissevent callback.
Anchor to ExamplesExamples
Anchor to Display a promotional announcementDisplay a promotional announcement
Display a promotional announcement with a survey link. This example shows an s-announcement with inline text and a link inviting customers to fill out a survey.
Display a promotional announcement

html
Anchor to Promote a members-only offerPromote a members-only offer
Display a personalized discount for signed-in customers. This example uses subdued text for the discount code so the main message stands out.
html
Anchor to Collect post-order feedbackCollect post-order feedback
Use an announcement as a teaser that opens a modal for longer-form content. This example pairs a prompt with a link that triggers a feedback survey.
html
Anchor to Best practicesBest practices
- Keep copy short: Fit the message in a single short line whenever possible so customers see it at a glance without needing to expand.
- Plan for truncation: The component has a strict maximum height. Content that exceeds the expanded state's height is clipped with no scrolling. Validate your copy length before shipping.
- Link to a modal for longer content: If you need to display surveys, detailed offers, or other long-form content, use the announcement bar as a teaser that opens a modal rather than overfilling the bar.