vuetify-toast-snackbar

Basic Vue toast service that uses Vuetify Snackbar component.
47,317 127
Install
npm install vuetify-toast-snackbar
Latest Version:0.6.1
Vue:1 · 2
License:MIT
Last Updated:Jan 4, 2023
Links: GitHub  ·  npm
Maintainer: eolant

Vuetify Toast Snackbar

Basic Vue toast service with queue support that uses Vuetify Snackbar component. Inspired by https://github.com/pzs/vuetify-toast

Installation

npm install vuetify-toast-snackbar

Demo

Demo: https://eolant.github.io/vuetify-toast-snackbar

Usage

Bundler (Webpack, Rollup)

import VuetifyToast from 'vuetify-toast-snackbar'

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'

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-ng

Basic Vue toast service that uses Vuetify Snackbar component for Vuetify 2.3+

25,369 22
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.6.1 MIT
0.6.0 MIT
0.5.0 MIT
0.4.3 MIT
0.4.2 MIT