@kugatsu/vuenotification

WebJar for @kugatsu/vuenotification

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

kugatsu__vuenotification
Last Version

Last Version

1.1.3
Release Date

Release Date

Type

Type

jar
Description

Description

@kugatsu/vuenotification
WebJar for @kugatsu/vuenotification
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/kugatsu765/vueNotification

Download kugatsu__vuenotification

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/kugatsu__vuenotification/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>kugatsu__vuenotification</artifactId>
    <version>1.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/kugatsu__vuenotification/
implementation 'org.webjars.npm:kugatsu__vuenotification:1.1.3'
// https://jarcasting.com/artifacts/org.webjars.npm/kugatsu__vuenotification/
implementation ("org.webjars.npm:kugatsu__vuenotification:1.1.3")
'org.webjars.npm:kugatsu__vuenotification:jar:1.1.3'
<dependency org="org.webjars.npm" name="kugatsu__vuenotification" rev="1.1.3">
  <artifact name="kugatsu__vuenotification" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='kugatsu__vuenotification', version='1.1.3')
)
libraryDependencies += "org.webjars.npm" % "kugatsu__vuenotification" % "1.1.3"
[org.webjars.npm/kugatsu__vuenotification "1.1.3"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : vue jar [2.6.6,3)

Project Modules

There are no modules declared in this project.

Notification Vue JS ๐Ÿš€

The Notification vue plugin allows you to display notifications from anywhere within your app. Just with one line of code. This notification plugin is unique from others as it utilises the GSAP library allowing you to animate your notifications in a near limitless number of ways

img vue notification img vue notification

How to use it

Install with npm. If you don't already have GSAP in your project, you also have to install it.

npm i @kugatsu/vuenotification --save
npm i gsap --save

Import with ES6

import VueNotification from "@kugatsu/vuenotification";

Vue.use(VueNotification, {
  timer: 20
});

Emit the notification where you want.

this.$notification.new("hello world", {  timer: 10 });
this.$notification.error("hello world", { infiniteTimer: false });
...

Parameters

Name Type Default value
message String " ๐Ÿšง You missed something ..."
title String null
timer Number 5(s)
infiniteTimer Boolean false
position String topRight
type String primary
[type] Object ( See type section )
showLeftIcn Boolean true
showCloseIcn Boolean false
animateIn Function ()=> TimelineMax
animateOut Function ()=> TimelineMax

position

Name Value
top center topCenter
top left topLeft
top right topRight
bottom center bottomCenter
bottom left bottomLeft
bottom right bottomRight

Type

There are 5 notifications types.

  • primary
  • dark
  • success
  • warning
  • error

To customise the colors of the notification you can do this globally or locally :

// Sample to change all error notifications
Vue.use(NotificationVuejs, {
  error: {
    background: "green",
    color: "red"
  }
});

Animation

To animate the in and out animation, we use GSAP. To customize the default animation, you have to add to your config object. animateIn and animateOut with a function that returns a gsap timeline.

Vue.use(NotificationVuejs, {
  animateIn: function() {
    var tl = new TimelineMax()
      .from(this.notificationEl, 0.6, {
        opacity: 0
      })
      .from(this.notificationEl, 0.4, {
        borderRadius: 100,
        width: 58,
        height: 58
      })
      .from(this.notificationElContent, 0.3, {
        opacity: 0
      });
    return tl;
  }
});

You can select the notification with a custom selector.

Selector Value to use
all notification this.notification
current notification this.notificationEl
all content of the notification this.notificationElContent
Notification title this.notificationTitle
Notification message this.notificationMessage
Notification icone this.notificationIcone
Notification close button this.notificationIconeClose

Credit

Icones

Icons made by Pixel perfect, Smashicons from www.flaticon.com is licensed by CC 3.0 BY

Versions

Version
1.1.3