Skip to content

Notification

BsNotification is a lightweight push notification component that display a notification message to user.

Overview

BsNotification is designed to mimic the push notifications that have been popularized by mobile and desktop operating systems. BsNotification are intended to be small interruptions to visitors or users, and therefore should contain minimal, to-the-point, non-interactive content.

Updated on v2.0.0

INFO

  • The component is opt-in for performance reasons and must be initialized first.
  • The component is a singleton instance and therefore only one <bs-notification> tag is allowed on a page. The $notification instance can then be called within the page scope.
  • To enable a $notification instance at application scope, place <bs-notification> tag in the main Vue file, e.g.: App.vue.

Variants

BsNotification provides five variants and can be easily called using $notification instance.

Display Placement

The notifications can be displayed on four sides of the page.

With ProgressBar

The notifications also has progress bar that can be displayed when needed.

Hiding Icons

There are cases when the notification icon is not needed. You can hide the icon using the iconOff property via its configuration option when creating new notification.

Added since v2.1.3

CSS Variables

Updated on v2.1.3
scss
--md-notification-background-color: #16181b;
--md-notification-border-radius: 0.375rem;
--md-notification-box-shadow-color: rgba(0, 0, 0, 0.2);
--md-notification-box-shadow-hover-color: rgba(0, 0, 0, 0.45);
--md-notification-color: #fff;
--md-notification-font-size: .9rem;
--md-notification-hover-color: #dee2e6;
--md-notification-opacity: 0.9;
--md-notification-title-weight: 500;
--md-notification-title-size: 110%;
--md-notification-padding-x: 1rem;
--md-notification-padding-y: 0.75rem;
--md-notification-progressbar-color: #ffbb33;
--md-notification-spacing: 0.75rem;
--md-notification-width: 350px;

API Reference

Released under the BSD-3-Clause License.