Components

Banner

Banners communicate prominent messages, such as system status, errors, or important information.

Stable
GitHub
Info banner

Anatomy

Anatomy
import {Banner} from '@staffbase/design';

<Banner>
  <Banner.Close />
</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

NameTypeDescription
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

Banner.Close accepts all native <button> props.

NameTypeDescription
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 announce the outcome of something the user has just done, add role="alert" to the component so assistive technologies announce the message immediately.

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.