Banner

A status message: 1 colored icon, a title, an optional description and up to 3 actions.

Installation

Installs the Base UI flavor. Switch in the right panel.

Playground

Inspect

Statuses

5 statuses, 2 contrasts. Low colors only the icon; high washes the whole banner.

Inspect
Low contrast

Default

Info

Success

High contrast

Default

Info

Success

Actions

3 variants. Primary sits at the edge next to a one-line title, and leads under a description.

Inspect

Enjoying BoringUI?

The registry has new components

Run the install command again to pull the latest versions.

Fixed

variant="fixed" runs edge to edge under your header. Scroll the content: the bar stays put. Press ✕: it closes and the content slides up.

Inspect

Custom icon

icon swaps in any icon, drawn in the status color.

Inspect

3 new components since your last visit

API Reference: Banner

PropTypeDefaultDescription
status"default" | "info" | "success" | "warning" | "error""default"Sets the color and the icon.
contrast"low" | "high""low"low colors only the icon. high tints the whole banner.
variant"inline" | "fixed""inline"fixed spans the full width and sticks to the top.
iconIconComponent—Replaces the status icon.
dismissiblebooleanfalseShows a ✕ button.
onDismiss() => void—Called when the ✕ is pressed.
dismissLabelstring"Dismiss"Label read by screen readers for the ✕.
openboolean—Controls visibility. Without it, the ✕ hides the banner.
size"default" | "compact"from SizeProviderDefault or compact.

API Reference: Parts

PropTypeDefaultDescription
BannerTitlepart—The message.
BannerDescriptionpart—Optional text under the title.
BannerActionspart—Up to 3 BannerAction. Primary sits at the edge, or first under a description.

API Reference: BannerAction

PropTypeDefaultDescription
variant"primary" | "secondary" | "ghost""secondary"The button style.
hrefstring—Renders a link instead of a button.
externalbooleanfalseOpens the link in a new tab.
onClick(event) => void—Called on click.