vuetify-toast-snackbar-ng

Basic Vue toast service that uses Vuetify Snackbar component for Vuetify 2.3+
25,369 22
Install
npm install vuetify-toast-snackbar-ng
Latest Version:0.7.5
Vue:1 · 2 · 3
License:MIT
Last Updated:Jun 6, 2022
Links: GitHub  ·  npm
Maintainer: hanjiawei

Vuetify Toast Snackbar for Vuetify 2.3+

Basic Vue toast service with queue support that uses Vuetify Snackbar component. Update from https://github.com/eolant/vuetify-toast-snackbar

Installation

npm install vuetify-toast-snackbar-ng

Usage

Bundler (Webpack, Rollup)

import VuetifyToast from 'vuetify-toast-snackbar-ng'

Vue.use(VuetifyToast, {
	x: 'right', // default
	y: 'bottom', // default
	color: 'info', // default
	icon: 'info',
	iconColor: '', // default
	classes: [
		'body-2'
	],
	timeout: 3000, // default
	dismissable: true, // default
	multiLine: false, // default
	vertical: false, // default
	queueable: false, // default
	showClose: false, // default
	closeText: '', // default
	closeIcon: 'close', // default
	closeColor: '', // default
	slot: [], //default
	shorts: {
		custom: {
			color: 'purple'
		}
	},
	property: '$toast' // default
})

Vue loader (e.g. Nuxt.js)

Update plugins/vuetify.js

import Vue from 'vue'
import Vuetify, { VSnackbar, VBtn, VIcon } from 'vuetify/lib'
import VuetifyToast from 'vuetify-toast-snackbar-ng'

Vue.use(Vuetify, {
  components: {
    VSnackbar,
    VBtn,
    VIcon
  }
})

Vue.use(VuetifyToast)

Call

this.$toast('Default toast')

this.$toast.info('Info toast')

this.$toast('Custom options', {
	color: 'green',
	dismissable: true,
	queueable: true
})

this.$toast.custom('Custom short')

this.$toast(null, {
	slot: [this.$createElement('button', ['Click here'])]
})

Get currently displayed Toast component

let cmp = this.$toast.getCmp()
cmp.message = 'Dynamic properties'
cmp.close()

Clear Toasts queue

let queue = this.$toast.clearQueue()

Related Packages

vuetify-toast-snackbar

Basic Vue toast service that uses Vuetify Snackbar component.

47,317 127
vuetify-sonner

Stackable toast component for Vuetify.

319,548 152
vuetify-use-dialog

A module that simplifies the creation of dialogs and snackbars in Vuetify.

59,325 60
vuetify-snackbar-toast

less redundant code, less time expensive, more sweet ;)

4,910
ftt-vue-components

some components for vuetify3/element-plus/... with vue3.

777

Version History

Version Released License
0.7.5 MIT
0.7.4 MIT
0.7.3 MIT
0.7.2 MIT
0.7.1 MIT