import {Banner} from '@staffbase/design';<Banner> <Banner.CloseButton /></Banner>
Examples
Variants
Info banner (default)
Success banner
Warning banner
Critical banner
Sizes
Small banner (default)
Medium banner
Layouts
Standalone banner (default)
Full bleed banner
API reference
Banner
Name
Type
Description
children
ReactNode
The content of the Banner.
variant
infosuccesswarningcritical
Defines the semantics / use case of Banner.
Default:info
size
smmd
Changes the size of the Banner.
Default:sm
layout
standalonebleed
Changes the style of the banner.
Default:standalone
Close Button
Name
Type
Description
aria-label
string
Accessible label describing the close action for screen readers.
Accessibility
As notification
If you’re using the banner as a notification to tell the user about the outcome of something they’ve just done, add role="alert" to the component so focus shifts to the notification banner.
Missing required field
Enter a valid email address.
Semantic HTML
If you’re putting multiple elements inside the banner, use semantic HTML — for example h2 for the heading, p for the content, and button or a for the CTA.
Anatomy
Banners have a consistent structure with a background color indicating their variant, optional icon, text content, and optional close button.
Properties
Variants
Banners come in four semantic variants to communicate different types of messages: Info for general information, Success for positive outcomes, Warning for cautions, and Critical for errors.
Layout
Banners can use either a Standalone layout with rounded corners for use within other elements, or a Bleed layout without border radius for full-width placement.
Size
Banners support two sizes: Small (default) with 12px body text, and Medium with 14px text and added padding for more prominent messages.
Behaviour
Close action
Banners can include a close button allowing users to dismiss the message. This is especially useful for informational or non-critical messages.
Usage Examples
File Manager — File Deletion Flow
The Info banner informs users about the effects of file deletion, helping them understand the consequences of their action.
Plugin Visibility Settings
Users with limited permissions see an Info banner explaining that content is visible to users and groups they cannot see.
Branding: Custom Fonts
Banners can be customized with additional styling while maintaining their core message communication purpose.