Skip to content

API Reference

The majority of settings for the Notifications component are configured using props:

vue
<notifications
  position="bottom right" 
  classes="my-custom-class"
  :width="200"
/>

Props

TIP

Note that all props are optional.

NameTypeDefaultDescription
positionString/Array'top right'Part of the screen where notifications will pop out
widthNumber/String300Width of notification holder, can be %, px string or number.
Valid values: '100%', '200px', 200
classesString/Array'vue-notification'List of classes that will be applied to notification element
groupStringnullName of the notification holder, if specified
durationNumber3000Time (in ms) to keep the notification on screen (if negative - notification will stay forever or until clicked)
speedNumber300Time (in ms) to show / hide notifications
animation-typeString'css'Type of animation, currently supported types are css and velocity
animation-nameStringnullAnimation name required for css animation
animationObjectCustomAnimation configuration for Velocity animation
maxNumberInfinityMaximum number of notifications that can be shown in notification holder
reverseBooleanfalseShow notifications in reverse order
ignoreDuplicatesBooleanfalseIgnore repeated instances of the same notification
closeOnClickBooleantrueClose notification when clicked
pauseOnHoverBooleanfalseKeep the notification open while mouse hovers on notification
dangerouslySetInnerHtmlBooleanfalseUse v-html to set title and text

Events

NameTypeDescription
click(item: NotificationItem) => voidThe callback function that is triggered when notification was clicked
destroy(item: NotificationItem) => voidThe callback function that is triggered when notification was destroyes
start(item: NotificationItem) => voidThe callback function that is triggered when notification was appeared

Plugin options

Configure the plugin itself using an additional options object:

js
app.use(Notifications, { name: "alert" });

WARNING

Setting componentName can cause issues when using SSR.

All options are optional:

NameTypeDefaultDescription
nameStringnotifyDefines the instance name. It's prefixed with the dollar sign. E.g. this.$notify
componentNameStringNotificationsThe component's name