Banner

Banner is used to highlight important information.

Page navigation navigation

React
readyReviewed for a11y
Rails
readyNot reviewed for a11y

React examples

Default

Info

GitHub users are now required to enable two-factor authentication as an additional security measure.

Tone variants

Banners can be used to convey different tones of information. Choose the correct variant for your use-case.

Banner variant guidelines

Critical

GitHub users are now required to enable two-factor authentication as an additional security measure.

Dismissible

Dismissible Banner guidelines

Info

GitHub users are now required to enable two-factor authentication as an additional security measure.

With actions

Banner actions guidelines

Info

GitHub users are now required to enable two-factor authentication as an additional security measure.

Visually hidden title

The Banner's title is still accessible to assistive technologies, but is visually hidden.

Info

GitHub users are now required to enable two-factor authentication as an additional security measure.

More code examples

See the Banner Storybook stories.

Props

NameRequiredDescription
aria-label
string
Provide an optional label to override the default name for the Banner landmark region
className
string
Provide an optional className to add to the outermost element rendered by the Banner
description
React.ReactNode
Provide an optional description for the Banner. This should provide supplemental information about the Banner
hideTitle
boolean
Whether to hide the title visually.
icon
React.ReactNode
Provide a custom icon for the Banner. This is only available when `variant` is `info` or `upsell`
onDismiss
() => void
Optionally provide a handler to be called when the banner is dismissed. Providing this prop will show a dismiss button
primaryAction
React.ReactNode
secondaryAction
React.ReactNode
title
React.ReactNode
The title for the Banner. This will be used as the accessible name and is required unless `Banner.Title` is used as a child
variant
'critical' | 'info' | 'success' | 'upsell' | 'warning'

Banner.Title

NameRequiredDescription
as
'h2' | 'h3' | 'h4' | 'h5' | 'h6'

Banner.Description

NameRequiredDescription
className
string
Class name(s) for custom styling.

Banner.PrimaryAction

NameRequiredDescription

Banner.SecondaryAction

NameRequiredDescription