Banner

Banner is used to highlight important information.

  • @primer/react@37.4.0
  • Draft
  • Reviewed for accessibility

Import

import {Banner} from '@primer/react/experimental'

Examples

View in Storybook

Props

NameDefaultDescription
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

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

Banner.Description

No props

Banner.PrimaryAction

No props

Banner.SecondaryAction

No props