vue-toaster-snackbar
Vue Toaster Snackbar is one of the best plugin available with toast and snackbar custom features.
Features
- Snackbar, Block and Action Blocks(WIP)
- Packed with Responsiveness and Style (Customisable)
- Progress Bar (enable/disable)
- Progress Bar pause on mouseover and resume on mouseleave
- Timeout (default: 3 seconds, infinite: 0)
- On click actions with custom emit event and value
Getting Started
Install using npm or yarn
# Install using npm npm install vue-toaster-snackbar # or Install with yarn yarn add vue-toaster-snackbar # register the plugin on vue ./main.js or ./main.ts import ToastSnackbar from 'vue-toaster-snackbar'; import "vue-toaster-snackbar/public/toast.scss"; Vue.use # declare the component in ./App.vue <template> <div id="app"> <Toast></Toast> .... </div></template>
Direct Installation
<!DOCTYPE html>
<html>
<head>
<title>ToastSnackbar Vue app</title>
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-toaster-snackbar@1.0.2/dist/vueToaster.umd.js"></script>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/vue-toaster-snackbar@1.0.2/public/toast.css" />
</head>
<body>
<div id="app">
<Toast></Toast>
{{ message }}
<button v-on:click="clickMe">Click me!</button>
</div>
<script>
var app = new Vue({
el: "#app",
data: {
message: "Hello Vue!"
},
methods: {
clickMe() {
this.$toast.snackbar("success", "This is a success message");
}
},
});
</script>
</body>
</html>
Usage
- Use the following commands from any component to trigger Toast,
# Snackbar this.$toast.snackbarthis.$toast.snackbarthis.$toast.snackbarthis.$toast.snackbar # Block this.$toast.blockthis.$toast.blockthis.$toast.blockthis.$toast.block # Custom // Custom Message StructureToastMessage =
Coming soon 😍
Support
License
Released under the MIT License