Skip to content
SENVENLI UI

Banner

A message about the page or the whole app, inline or floating, in an information, warning, danger or success tone.
A section message
import { Banner } from "@senvenli/react/feedback";

Examples

Tones

The icon and the title say the status; a danger banner is announced as an alert.

Dismissible

`onDismiss` adds the close button. Leave it out for errors that must be resolved.

Floating

Pinned to the bottom of the viewport until the visitor acts on it, like a cookie notice.

Guidelines

When to use it

  • Telling people something about this page that they need to read or act on.

Use something else when

  • Only an item's status needs showing. Badge

Do and avoid

  • Say why and what to do; omit the close button for errors that must be resolved.

Accessibility

Built in

  • Announced with the right urgency for its tone.
  • The close button is named "Close" or your dismissLabel.

You provide

  • A specific dismissLabel when "Close" alone is vague.

API reference

Banner

tone
BannerTone
children
React.ReactNode

Why, and what to do.

actions
React.ReactNode

Inline: up to two link actions. Floating: a default (neutral) Button, never the gold primary.

onDismiss
() => void

Shows a close button; omit for errors that must be resolved.

dismissLabel
string

The close button's name when "Close" alone is too vague ("Close cookie notice").

placement
"inline" | "floating"
title
React.ReactNode

What happened, one line.

aria-label
string

Names the region ("Cookie notice").

avoid
string | RefObject<HTMLElement | null>

A sticky bottom bar to sit above: its element (measured from its top edge) or a CSS length with a unit ("72px").

icon
IconName | null

Replaces the tone icon ("cookie"); null shows none (narrow phone layouts).