Banner styling reference
On this page
Banners are the messages shown in a row on a POS screen, such as a payment error at checkout or a notice in the cart. Each banner starts with an icon, and some have a button that operators tap to retry an action or close the banner. You can change banner colors, corners, text size, the color of the icon, etc. Follow the POS styling API rules when you style banners.
Where a banner appears
Banners appear on many POS screens. For example:
- Messages from a payment terminal, and payment errors at checkout
- Notices in the cart, such as a delivery whose details have changed
- Notices on settings screens, and in dialogs opened from the navigation
- Whether a station is available
- The notice on the shift screen that the register must be connected to end a shift
Parts
| Part | What it is | Available from |
|---|---|---|
banner-root |
The whole banner, with the fill, border, and type. | v22.0.17 |
banner-icon |
The icon at the start of the banner, or the spinner while it loads. | v22.0.17 |
banner-message |
The banner’s message. | v22.0.17 |
banner-dismiss |
The round button at the corner that dismisses the banner. | v22.0.17 |
banner-action |
The button at the end that takes the banner’s action, such as Retry. | v22.0.17 |
The Available from column shows the first release that carries the name.
Attributes
Narrow banner-root by this, inside :where(), to style one theme of banner.
| Attribute | Values | Default | Available from |
|---|---|---|---|
data-theme |
brand, notify, warning, neutral, alert |
brand |
v22.0.17 |
brand: the primary soft fill, for most messages.notify: the soft error fill, for something that needs attention, such as a payment that was cancelled.warning: the same colors asnotify.neutral: a raised fill with a hairline border.alert: no fill or border, so the screen behind shows through. Used only on the notice on the shift screen.
Component properties
Set these on banner-root or on :root. The text size you set doesn’t apply to these four
banners, which have a fixed text size:
- The error on the options screen for a rental
- The rental error on the screen for a fulfillment
- The error under the barcode scanner
- The notice in the Square manual payment dialog
| Property | What it sets | Default | Available from |
|---|---|---|---|
--sc-banner-font-size |
The size of the text. | var(–sc-type-body-medium-size) | v22.0.17 |
--sc-banner-font-weight |
The weight of the text. | var(–sc-type-body-medium-weight) | v22.0.17 |
--sc-banner-line-height |
The line height of the text. | var(–sc-type-body-medium-line-height) | v22.0.17 |
--sc-banner-action-font-size |
The size of the action button’s text. | var(–sc-type-label-large-size) | v22.0.17 |
--sc-banner-action-font-weight |
The weight of the action button’s text. | var(–sc-type-label-large-weight-em) | v22.0.17 |
--sc-banner-action-line-height |
The line height of the action button’s text. | var(–sc-type-label-large-line-height) | v22.0.17 |
Examples
Each example is tested against the POS on every change.
“Make the banners that need attention our brand red.”
```css
background-color: #b42318; border-color: #b42318; color: #ffffff; } ```
“Make the banners’ text bigger.”
```css
part~=’banner-root’ { –sc-banner-font-size: 17px; –sc-banner-line-height: 24px; } ```
“Round the banners’ corners.”
```css
part~=’banner-root’ { border-radius: 12px; } ```
“Give the Retry buttons our brand color.”
```css
[part~=’banner-action’] { background-color: #0b5394; color: #ffffff; } ```
“Color the icon at the start of each banner.”
```css
[part~=’banner-icon’] { color: #0b5394; } ```
What can’t be styled yet
- One banner on its own, such as the shift screen’s notice, since no banner has a name yet
- A banner that can be pressed, apart from one that can’t
- The action and dismiss buttons while they’re hovered, apart from the other states: a fill you set on them also replaces the fill they take while hovered
- What a few screens put inside a banner beside or instead of a message, such as the countdown on a rental hold in the cart and the error on a rental’s options screen
Retired
None yet.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.