Banner

A banner is a short message that is shared with users in an unobtrusive, full-width container that cannot be dismissed.

Examples

Basic

Banners can be styled with one of 9 different colors using the color prop. A basic banner should only be used when the banner color does not represent status or severity.

Default banner

Red banner

Orangered banner

Orange banner

Yellow banner

Green banner

Teal banner

Blue banner

Purple banner

Status

When a banner is used to convey status it should be styled using the status prop. Additionally, it is advised to pass an icon inside the banner to convey the status in a way besides just color.

The screenReaderText prop should also be passed in to convey the status/severity of the banner to users of certain assistive technologies such as screen readers.

In the following example, a flex layout is used inside the banner content to show one possible way to create spacing between the icons and banner text.

Success banner
Success banner

Warning banner
Warning banner

Danger banner
Danger banner

Info banner
Info banner

Custom banner
Custom banner

Props

*required
NameTypeDefaultDescription
childrenReact.ReactNodeContent rendered inside the banner.
classNamestringAdditional classes added to the banner.
color'red' | 'orangered' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'purple'Color options for the banner, will be overwritten by any applied using the status prop.
isStickybooleanfalseIf set to true, the banner sticks to the top of its container
screenReaderTextstringText announced by screen readers to indicate the type of banner. This prop should only be passed in when the banner conveys status/severity.
status'success' | 'warning' | 'danger' | 'info' | 'custom'Status style options for the banner, will overwrite any color applied using the color prop.

CSS variables

Expand or collapse columnSelectorVariableValue