Skip to content
Storybook

Banner

Full-width, page-level announcement above the header. One per page.

Preview

React · live from the Storybook
Banner preview

HTML and CSS

The same component as plain HTML with pixels-ui.css, no framework needed.

Pixels 2.0 is here — new tokens, RTL and density modes.Read more
Scheduled maintenance on Sunday, 02:00–04:00 GMT.
Your trial ends in 3 days.

Usage

  • Dismissible unless critical.

Installation

Included in the core files. No extra install.

HTML
<link rel="stylesheet" href="/css/pixels-tokens.css">
<link rel="stylesheet" href="/css/pixels-ui.css">
<script src="/js/pixels-ui.js" defer></script>

API reference

Class / attributeTypeDescription
px-banner · --neutral · --warningclassTone (Brand default).

Figma properties

Banner6 variants · page “Alerts & Notifications”Open

Full-width, page-level announcement above the header (maintenance, trial ending, policy changes). One per page; dismissible unless critical. Horizontal padding follows --px-layout-margin.

PropertyTypeValues
MessageText“Scheduled maintenance on Sunday, 02:00–04:00 GMT. Some features may be unavailable.”
CloseBoolean—
ToneVariantBrand Neutral Warning
DirectionVariantLTR RTL

Design tokens

Component tokens from the Figma Component collection. Override them to restyle just this component.

TokenAliasLight value
--px-banner-brand-backgroundcolor-background-brand-default#2563eb
--px-banner-brand-contentcolor-content-on-color#ffffff
--px-banner-brand-iconcolor-content-on-color#ffffff
--px-banner-neutral-backgroundcolor-surface-inverse#101828
--px-banner-neutral-contentcolor-content-inverse#ffffff
--px-banner-neutral-iconcolor-content-inverse#ffffff
--px-banner-warning-backgroundcolor-background-warning-subtle#fffaeb
--px-banner-warning-contentcolor-content-neutral-primary#101828
--px-banner-warning-iconcolor-content-warning-default#b54708

Accessibility

  • Give the region a label.