Components/Feedback
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/topbanner
Banners let's user know about ongoing promotions or marketing deals on their site.
<StatusToast/> instead.Control if Top Banner can be closed by a users with dismissible prop.
Add button to a top banner with action prop. It's recommended to always provide a corresponding action if possible.
Control type of action Top banner has through action property:
<TopBanner.ActionButton/> to provide a main CTA (default).<TopBanner.ActionTextButton/> to provide a secondary action, like "Learn more".action is a node. This can also be used when more than one actions are needed.Control whether the Top Banner sticks to the top of its container using the position prop:
static (default) to allow the banner to scroll out of view beneath the top fold.sticky to keep the banner visible as the user scrolls, with content moving beneath it.Minimum component height is 48px. Component will grow together with the content provided. Heigh is not limited, so be cautious about providing very long texts as it will overlay content behind it.
Top banner component can be used inside of a modal or other container.
Add top banner at the top of <Page/> to promotion premium.
| Name | Type | Default | Description |
|---|---|---|---|
action | ReactNode | — | An action component to display in the top banner. The component can be one of these types: Can be either: - <TopBanner.ActionButton/> - <TopBanner.ActionLink/> - custom On mobile (<WixDesignSystemProvider mobile/>) the action renders below the text and spans the banner width. |
children | ReactNode | — | The main content of the top banner. |
dataHook | string | — | Applies a data-hook HTML attribute that can be used in tests. |
dismissible | boolean | true | Determines whether the top banner should render a dismiss button. |
dismissLabel | string | — | Aria label for the dismiss button. |
onDismiss | (event: MouseEvent<Element, MouseEvent>) => void | — | Callback function called whenever the user clicks the dismiss button. |
position | "static" | "sticky" | static | Determines if the top banner stays fixed at the top of its container. |
zIndex | number | 1 | Controls the z-index of the component. |
Import the driver matching your test environment:
| Method | Description |
|---|---|
getContent | Gets the content of top banner. |
hasDismissButton | Checks if the dismiss button exists. |
clickDismissButton | Clicks the dismiss button |
exists | Checks whether the component found with the given data hook. |
element | Gets the component root element. |
click | Clicks on the component root element. |
base | Returns UniDriver for the base element. |
WixDesignSystemProvider with mobile) the banner stacks vertically. The text and the dismiss button share the top row, the text is start-aligned and uses the full width left by the dismiss button, and the action renders below as a full-width small button. The dismiss button keeps its 24px icon and gets a 44px touch area. The banner grows with its content and mirrors fully in RTL. Desktop is unchanged. (#17332) — has visual changes--wds-top-banner-content-color, so themes with the purple fill get light content again instead of the dark content intended for Harmony (odeditor)'s light fill. (#16648) — has visual changesLast updated: 22 October 2026