cnippet/ui
  1. ui
  2. feedback
  3. banner

feedback

Banner

Full-width announcement bar for promos, maintenance notices, trial reminders and cookie consent, in neutral, primary and status tones. Copy-paste ready.

Installation

Usage

Anatomy

Good to know

  • Banner is for site-wide or page-wide messages that sit above the content. For a message about one form or section, use Alert; for something that comes and goes, use Toast.
  • The banner doesn't hide itself. BannerClose is a plain button, so you choose what dismissing means: for this visit (state), or for good (save it to a cookie or local storage).
  • It has no role by default. Add role="status" if it appears after the page loads and should be announced, or role="region" with an aria-label if users should be able to jump to it.
  • On narrow screens the actions wrap onto their own row.

API Reference

BannerClose

A button with aria-label="Dismiss" and an X icon. Pass children to replace the icon.

Examples

Tones

A bottom bar with two actions that goes away once the user picks one.