Alert banner
Alert banners show pressing and high-signal messages, such as system alerts. They're meant to be noticed and prompt users to take action.


Anatomy#


Options#
Table of options#
From the design point of view, each component has a number of options. These options and their names are platform agnostic, and each implementation should adapt these to fit into their framework.
Usage guidelines#
Make alert banners actionable#
Whenever possible, add an in-line action button if there's a way for a user to quickly address the issue associated with an alert.


Consider including a close button#
The close button is optional, depending on context. Consider adding one to let a user easily dismiss the alert.


Use alert banners only for system-level messaging#
Alert banners should be reserved only for high-signal, system-level alert messages, such as internet connection issues, expirations of subscriptions, or major changes.
For in-app notifications, lightweight confirmations of actions, or more promotional messaging, use a


Be aware of color and semantic meaning#
Don’t use yellow or orange colors for errors because the contrast is not accessible.
If you need to show a “notice” message or other non-critical communication, use the gray (neutral) or blue (informative) semantic color options. Reserve the red (negative) option only for errors that directly interrupt or block a user’s experience — not for nice-to-know information.


Include only one action per alert banner#
Don't include more than one action in an alert banner. Having more than one action to choose from can be overwhelming, and it can become difficult for users to decide what to do next in such a small space.


Place alert banners at the top#
Alert banners should appear at the top of a page, below the header.


Don't stack alert banners#
Don't show multiple alert banners at the same time. If a new alert banner appears with a higher priority message, it should replace an existing alert banner of lesser importance until the higher priority one has been addressed.


Overlay content#
Overlay an alert banner when it's expected to fade in and out without impacting the content underneath it, and when it's not hiding any important actions or information by being there. An alert banner should only overlay content if it is dismissible.


Push content#
Push an alert banner when it's expected to stay in place, when it's not dismissible, or when no information should be hidden from the view.


Persist errors to maintain visibility#
If a user dismisses an alert banner without addressing an error that needs to be resolved, it should come back into view at the next possible occasion.
Don't let alert banners time out#
Never allow alert banners to time out. Since these are system-level messages, they should not dismiss on their own unless there is a change in the system that resolves an issue (e.g., regaining internet connectivity after losing it).
Content standards#
Don't include periods in short phrases or single sentences#
Do not include periods in alert banner messages that are short phrases or single sentences. This helps keep the text quicker to read and easier to parse.
If the message must be more than one sentence in order to convey the alert's information, use a period at the end of each sentence.




Keep text concise and clear#
Keep an alert banner's message concise while still being clear, using either a short phrase or a complete sentence that describes what's happening and what someone needs to know.
Whenever possible, include an in-line action for a user to take so that they can readily address the issue explained in the message.




Internationalization#
Keyboard interactions#
Changelog#
- Updated all colors to 6.0.0
- Changed text to regular weight instead of bold
- Added guidelines for period usage
- Left-aligned content for single-line designs in desktop scale
- Corrected padding and margins in mobile scale
- Corrected button text size in desktop scale
- Corrected baseline of text in desktop scale
- Corrected informative and error icon placement
- This component has been added to the website
Design checklist#

All interactive states
Includes all interactive states that are applicable (hover, down, focus, keyboard focus, disabled).

All color themes
Works properly across all four color themes (lightest, light, dark, darkest).

All platform scales
Includes a desktop scale (UWP, macOS, web desktop) and a mobile scale (iOS, Android, web mobile).

Accessible use of color
Color is not used as the only visual means of conveying information (WCAG 2.0 1.4.1).

Accessible contrast for text
Text has a contrast ratio of at least 4.5:1 for small text and at least 3:1 for large text (WCAG 2.0 1.4.3).

Accessible contrast for UI components
Visual information required to identify components and states (except inactive components) has a contrast ratio of at least 3:1 (WCAG 2.1 1.4.11).

Content design
UI language and information design considerations have been incorporated into component design.

Defined options
Includes relevant options (variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.)

Defined behaviors
Includes guidelines for keyboard focus, layout (wrapping, truncation, overflow), animation, interactions, etc.

Usage guidelines
Includes a list of dos and don'ts that highlight best practices and common mistakes.

Writing guidelines
Includes content standards or usage guidelines for how to write or format in-product content for the component.

Internationalization guidelines
Works properly across various locales and includes guidelines for bi-directionality (RTL).

Keyboard interactions
Follows WCAG 2.0 standards for keyboard accessibility guidelines and includes a description of the keyboard interactions.

Design tokens
All design attributes (color, typography, layout, animation, etc.) are available as design tokens.

UI kit
Includes a downloadable XD file that shows multiple options, states, color themes, and platform scales.

Generated UI kit
Includes a downloadable XD file, generated by code using design tokens defined in Spectrum DNA, and shows multiple options, states, color themes, and platform scales.

In Spectrum for Adobe XD plugin
Component is included in the Spectrum for Adobe XD plugin.