TopBanner

Components/Feedback

Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/topbanner

Overview

Copy

Banners let's user know about ongoing promotions or marketing deals on their site.

Do

  • Use it to promote premium related offers or market features under premium plans.
  • Use it with short and clear content.
  • Provide a clear action that user can take with "action" property.
  • Allow users to dismiss it.

Don't

  • Don't use it as a notification, to inform user about system status changes. Use <StatusToast/> instead.
  • Don't use it with too much text. The component can support multiple lines, but it will cover content under it and take too much attention.

Feature examples

Close button

Control if Top Banner can be closed by a users with dismissible prop.

Copy

Action

Add button to a top banner with action prop. It's recommended to always provide a corresponding action if possible.

Copy

Action type

Control type of action Top banner has through action property:

  • Use <TopBanner.ActionButton/> to provide a main CTA (default).
  • Use <TopBanner.ActionTextButton/> to provide a secondary action, like "Learn more".
  • In specific cases, you can provide a different button styling as action is a node. This can also be used when more than one actions are needed.
Copy

Position

Control whether the Top Banner sticks to the top of its container using the position prop:

  • Use static (default) to allow the banner to scroll out of view beneath the top fold.
  • Use sticky to keep the banner visible as the user scrolls, with content moving beneath it.
Copy

Height

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.

Copy

Common use case examples

In modals

Top banner component can be used inside of a modal or other container.

Copy

In pages

Add top banner at the top of <Page/> to promotion premium.

Copy

Code

Copy

Props

NameTypeDefaultDescription
actionReactNode—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.
childrenReactNode—The main content of the top banner.
dataHookstring—Applies a data-hook HTML attribute that can be used in tests.
dismissiblebooleantrueDetermines whether the top banner should render a dismiss button.
dismissLabelstring—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"staticDetermines if the top banner stays fixed at the top of its container.
zIndexnumber1Controls the z-index of the component.

Testkit

Import the driver matching your test environment:

Copy

Driver methods

MethodDescription
getContentGets the content of top banner.
hasDismissButtonChecks if the dismiss button exists.
clickDismissButtonClicks the dismiss button
existsChecks whether the component found with the given data hook.
elementGets the component root element.
clickClicks on the component root element.
baseReturns UniDriver for the base element.

Changelog

  • 1.340.0 (2026-10-21) — maintenance release, no component-specific changes
  • 1.339.0 (2026-10-19) — maintenance release, no component-specific changes
  • 1.338.0 (2026-10-15) — maintenance release, no component-specific changes
  • 1.335.0 (2026-10-12) — feat: on mobile (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
  • 1.330.0 (2026-09-28) — maintenance release, no component-specific changes
  • 1.329.0 (2026-09-24) — maintenance release, no component-specific changes
  • 1.328.0 (2026-09-22) — maintenance release, no component-specific changes
  • 1.327.0 (2026-09-21) — maintenance release, no component-specific changes
  • 1.325.0 (2026-09-17) — maintenance release, no component-specific changes
  • 1.310.0 (2026-08-10) — maintenance release, no component-specific changes
  • 1.305.1 (2026-07-30) — fix: restore readable contrast for the text and the dismiss icon — their color now follows the banner fill via --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 changes
  • 1.299.0 (2026-07-17) — breaking: update visual styling (#16579) — has visual changes
  • 1.292.0 (2026-06-22) — maintenance release, no component-specific changes
  • 1.260.0 (2026-03-17) — maintenance release, no component-specific changes
  • 1.254.0 (2026-02-03) — maintenance release, no component-specific changes
  • 1.250.0 (2026-01-27) — maintenance release, no component-specific changes
  • 1.169.0 (2025-03-10) — maintenance release, no component-specific changes
  • 1.144.0 (2024-12-03) — maintenance release, no component-specific changes
  • 1.143.0 (2024-11-25) — feat: premium top banner (#14296)

Last updated: 22 October 2026

Did this help?