vue-notif

vue v2 notification component which can be used either through js or html
5,668 3
Install
npm install vue-notif
Latest Version:2.0.0
Older releases:2
License:MIT
Last Updated:Jan 3, 2023
Links: GitHub  ·  npm
Maintainer: ctf0

Vue Notif
npm npm

Installation

npm install vue-notif --save

Usage

  • register the component "we use Bulma for styling the notification cards".

    import Vue from 'vue'
    window.EventHub = require('vuemit')
    
    Vue.component('MyNotification', require('vue-notif').default)
    
  • add the component to your page

    <div class="notif-container">
        <my-notification></my-notification>
    </div>
    
  • now call it either

    • from html

      <div class="notif-container">
          <my-notification
              title="title"
              body="body"
              type="success/error/primary/warning"
              :icon="false"
              :duration="1/2/etc.."
              :on-close="somefunction()">
          </my-notification>
      </div>
      
    • or from js

      EventHub.fire('showNotif', {
          title: 'title',
          body: 'body',
          type: 'success',
          duration: 1,
          icon: false,
          onClose(){
              // what happen when notification is closed
          }
      });
      
    prop required type default
    title :x: string null
    body :x: string null
    type :x: string info
    duration :x: number in seconds / null "card will remain visible"
    icon :x: bool true
    onClose :x: function null
  • clicking the card itself will dismiss the notification as well.

Related Packages

vue-toastification

Toasts for Vue made easy!

8,439,951 3,362
@brackets/vue-toastification

Toasts for Vue made easy with custom component!

18,111 1
@enso-ui/search-mode

Search mode selector for Enso UI tables.

12,314 0
@enso-ui/card

Composable Bulma card primitives for Enso UI.

12,279 0

Version History

Version Released Vue License
2.0.0 MIT
1.1.10 MIT
1.1.9 MIT
1.1.8 MIT
1.1.6 MIT