For the best experience, please use this page on a laptop or desktop screen.
"Banner Header"
<BannerItem>Error 1</BannerItem>
<BannerItem>Error 2</BannerItem>
<BannerItem>Error 3</BannerItem>
<BannerItem>Error 4</BannerItem>
<BannerItem>Error 5</BannerItem>
<BannerItem>Error 6</BannerItem>
Banner is a component to render alert notifications.
They are composed of banner items describing errors as per the usecase.
Examples
Basic Banner
Banner Header
Error 1
Error 2
Error 3
Error 4
Error 5
Error 6
Banners with different intents
Error Banner Component
This is Error Banner Component
Warning Banner Component
Success Banner Component
Info Banner Component
Banners with different list types
Numeric List Banner Component
Error 1
Error 2
Error 3
Bullet List Banner Component
Error 1
Error 2
Error 3
No list Banner Component
This is Error Banner Component
The list type of the banner items (i.e numeric or bullets) can be handled by providing $as prop. Whenever $as is set to ul or ol, the role of BannerItemContainer will automatically be set to list. To provide custom role to BannerItemContainer, pass role prop to Banner component.
Fixed Height Banner
Banner Header
Error 1
Error 2
Error 3
Error 4
Error 5
Error 6
Error 7
Error 8
Error 9
Error 10
To fix the height of error list container, user needs to provide overrides to BannerItemContainer or Root.
Custom Title Component
This is a custom title Component
Error 1
Error 2
Error 3
Error 4
Error 5
Error 6
Title property of Banner accepts ReactNode. Hence, a custom title component can also be passed to the title prop of banner.
Hyperspace form with banner
Closeable Banner
Banner Header
Error 1
Error 2
Error 3
Error 4
Error 5
Error 6
Don't unmount banner on the basis of visible prop. Instead let Banner handle the state, or else animation
won't work
Banner with Buttons
Banner with Content and Buttons
Error 1
Error 2
Error 3
Error 4
Error 5
Error 6
Closeable Banner with Buttons
We can add buttons to the banner header by passing them as children to the titleEndEnhancer prop.
Usage of buttons should be restricted to:
Size: xxs
Variants: primary and secondary
API
Banner props
Name
Type
Default
Description
$as
'ol' | 'ul' | 'div'
div
Defines the numeric/bullet/none style for bannerItem list
children
react node
Banner items
className
string
Classes to apply on Banner Root
closeable
boolean
false
should banner be a closeable banner (user would need to control the visiblity using visible prop)
collapsible
boolean
true
Adds show/hide button to the banner.
intent
'error' | 'warning' | 'success' | 'info'
error
Defines the intent of the banner.
maxItemContainerHeight
string
Sets max height of the items container list.
overrides
custom
Lets you customize all aspects of the component.
title
react node
Defines the title of the banner.
titleEndEnhancer
react node
To add Buttons to end of title (use only xxs size buttons)
visible
boolean
true
To control visibility for closeable icon with the state update function given as onClose