New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mathieustan/vue-notification

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mathieustan/vue-notification

Clean Notifications made with VueJs

  • 0.1.3-rc.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
22
decreased by-42.11%
Maintainers
1
Weekly downloads
 
Created
Source

vue-notification

Codacy Badge Codacy Badge

A Notification (snackbar) Vue component. Compatible with Vue 2.x

Demo

To view a demo online: https://vue-notification.netlify.com/

Install

npm install @mathieustan/vue-notification --save

or

yarn add @mathieustan/vue-notification
import VueNotification from '@mathieustan/vue-notification';
Vue.use(VueNotification);

// Or with options (like breakpoints)
Vue.use(VueNotification, {
  breakpoints: {
    0: {
      bottom: true,
    },
    480: {
      top: true,
      right: true,
    },
  },
});

Usage

<script>
export default {
  // ...
  methods: {
    showNotification () {
      this.$notify('Hello, I am a notification');
    },
  },
  //...
};

Available props

PropTypeDefaultDescription
messageString''Message to show on notification
typeStringShow notification with specific type (info, success, warning, error, offline)
topBooleanfalseAllow to position notification 'top'
bottomBooleantrueAllow to position notification 'bottom'
leftBooleanfalseAllow to position notification 'left'
rightBooleanfalseAllow to position notification 'right'
offsetNumber0Add extra offset to notification (from top)
closeDelayNumber4500Delay before closing notification (in ms)
multiLineBooleanfalseMakes the notification higher (mobile) (extra padding)
actionTextString''Will add a button with this text after message
onActionClickFunctionAction when button will be clicked
showCloseBooleanfalseWill add a close button
hideIconBooleanfalseAllow to hide icon for types (success,info,...)
fullWidthBooleanfalseForce notification to full width
themeObjectfalseUpdate default theme (More informations here Theme)

Theme

:rocket: It's now possible to surcharge default theme colors & box-shadow. Theme object looks like this :point_down:

{
  colors: {
    success: '#4f88ff',
    successDarken: '#2d71fe',
    info: '#5d6a89',
    infoDarken: '#535f7b',
    warning: '#f8a623',
    warningDarken: '#f69a07',
    error: '#ff4577',
    errorDarken: '#ff245f',
    offline: '#ff4577',
    offlineDarken: '#ff245f',
  },
  boxShadow: `0px 3px 5px -1px rgba(0,0,0,0.2),
    0px 6px 10px 0px rgba(0,0,0,0.14),
    0px 1px 18px 0px rgba(0,0,0,0.12)`,
}

Examples : There are two ways to update theme.

  1. Options when init VueNotification
import VueNotification from '@mathieustan/vue-notification';
Vue.use(VueNotification, {
  theme: {
    // darken colors are used for background on icon
    colors: {
      success: '#54d861',
      darkenSuccess: '#2d8e36',
      info: '#5d6a89',
      darkenInfo: '#535f7b',
      warning: '#f8a623',
      darkenWarning: '#f69a07',
      error: '#ff4577',
      darkenError: '#ff245f',
      offline: '#ff4577',
      darkenOffline: '#ff245f',
    },
    boxShadow: '10px 5px 5px red',
  },
});
  1. Theme properties when calling $notify
<script>
export default {
  // ...
  methods: {
    showNotification () {
      this.$notify({
        message: 'Hello Wolrd',
        theme: {
          colors: {
            success: '#54d861',
            darkenSuccess: '#2d8e36',
            info: '#5d6a89',
            darkenInfo: '#535f7b',
            warning: '#f8a623',
            darkenWarning: '#f69a07',
            error: '#ff4577',
            darkenError: '#ff245f',
            offline: '#ff4577',
            darkenOffline: '#ff245f',
          },
          boxShadow: '10px 5px 5px red',
        },
      });
    },
  },
  //...
};

Keywords

FAQs

Package last updated on 03 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc