banner component

Drop-in semantic component. See examples, sizes, variants, and source.

Wide page-level message bar. Apply intent (error, warning, success, info, feature) and an optional style (light, lighter, stroke) to banner. Add dismissible for a close button or data-auto-dismiss="ms" for timed close. Stacking, persistence (data-persist), progress bars, and the Banner.create() / Banner.dismissAll() JS API live in banner.js.

Class API Reference

Type Class Usage Notes
Base banner Required base class Always required
banners Group container — child banners inherit style Wrap with banners light etc.
content Inner flex row holding icon + title + description Inside banner
title Bold leading label Inside .content
description Body text Inside .content
actions Trailing link area — accepts multiple for spacing Inside banner
Sizes compact Tight padding, small text Modifier on banner
(default) Standard size No size class needed
xl Large padding, big title Modifier on banner
Intents error Red — destructive / failure Alias: negative
warning Amber — caution Modifier on banner
success Green — confirmation Alias: positive
info Blue — informational Alias: primary
feature Purple — announcement / promo Modifier on banner
Variants (default) Filled — solid intent background Alias: filled
light Tinted background with darker text + border Modifier on banner
lighter Very subtle 50% tint Modifier on banner
stroke Transparent background with intent border Alias: outline
Position sticky-top Sticks to top of scroll container Modifier on banner
fixed-top Pinned to viewport top, full-width Modifier on banner
fixed-bottom Pinned to viewport bottom, full-width Modifier on banner
Behaviour dismissible Shows close button — also reserves right padding Modifier on banner
data-auto-dismiss="ms" Auto-close after N milliseconds e.g. data-auto-dismiss="5000"
data-progress Animated progress bar tied to auto-dismiss HTML attribute
data-countdown Visible seconds-remaining counter HTML attribute
data-banner-id + data-persist Remember dismissal in localStorage by id Reset via Banner.clearDismissed()