Skip to content

Notification Banner

Notification Banners provide prominent feedback to the user. They are typically used for system-wide alerts, success confirmations, or errors. 🔔

You can install the Notification Banner component using the global design system bundle or as a standalone script.

<script src="https://webcdn.ringover.com/app/download/design-system/lts/design-system.js"></script>
<script>
const { RoNotificationBanner } = RingoUI;
customElements.define('ro-notification-banner', RoNotificationBanner);
</script>
<script src="https://webcdn.ringover.com/app/download/design-system/lts/notification-banner.js"></script>
<script>
customElements.define('ro-notification-banner', RoNotificationBanner.RoNotificationBanner);
</script>

Use the <ro-notification-banner> element. Set the data-ro-color attribute to define the context (success, warning, error, etc.) and message for the text.

<ro-notification-banner
data-ro-color="success"
message="Your changes have been saved successfully.">
</ro-notification-banner>
Preview

The banner supports several semantic colors: success, warning, danger, neutral (default), and black.

<ro-notification-banner message="Info (neutral)"></ro-notification-banner>
<ro-notification-banner data-ro-color="success" message="Success"></ro-notification-banner>
<ro-notification-banner data-ro-color="warning" message="Warning"></ro-notification-banner>
<ro-notification-banner data-ro-color="danger" message="Error"></ro-notification-banner>
<ro-notification-banner data-ro-color="black" message="System (Black)"></ro-notification-banner>
Preview

Banners can have up to three action buttons and a dismiss button. Use attributes like action-label and dismissible to configure them.

<ro-notification-banner
id="banner-actions"
data-ro-color="warning"
message="Your subscription is expiring soon."
action-label="Renew Now"
data-action="renew"
secondary-action-label="Remind Later"
data-secondary-action="remind"
dismissible
dismissible-label="Close">
</ro-notification-banner>
Preview
AttributeDescription
data-ro-colorSemantic color. Options: success, warning, danger, neutral, black.
messageThe text content of the banner.
dismissibleBoolean. If present, shows a close/dismiss button.
dismissible-labelLabel for the dismiss button.
dismissible-iconIcon for the dismiss button. Default: cross-circle.
action-labelLabel for the primary action button.
data-actionIdentifier string included in the action-click event detail.
action-iconIcon for the primary action. Default: arrow-right-circle.
secondary-action-labelLabel for the secondary action button.
data-secondary-actionIdentifier for the secondary action event.
tertiary-action-labelLabel for the tertiary action button.
data-tertiary-actionIdentifier for the tertiary action event.

The banner emits custom events when buttons are clicked.

Event NameDetailDescription
action-click{ action, type, message }Fired when the primary action button is clicked.
secondary-action-click{ action, type, message }Fired when the secondary action button is clicked.
tertiary-action-click{ action, type, message }Fired when the tertiary action button is clicked.
banner-dismissedundefinedFired when the banner is removed via the dismiss button.
const banner = document.getElementById("banner-actions");
// Handle primary action
banner.addEventListener("action-click", (e) => {
console.log("Primary action clicked:", e.detail.action); // "renew"
if (e.detail.action === "renew") {
// Redirect to renewal page
}
});
// Handle secondary action
banner.addEventListener("secondary-action-click", (e) => {
console.log("Secondary action clicked:", e.detail.action); // "remind"
});
// Handle dismissal
banner.addEventListener("banner-dismissed", () => {
console.log("Banner was closed by the user.");
});