Category: Notification

Easy Toast & Snackbar Library For Vue 3

An easy yet customizable toast & snackbar library for Vue 3 applications. Fully compatible with the Composition API and Options API. How to use it: 1. Import and register the library. import { createApp } from “vue”; import { SnackbarService, Vue3Snackbar } from “vue3-snackbar”; // stylesheet import “vue3-snackbar/dist/style.css”; import App from “./App.vue”; const app = createApp(App); app.use(SnackbarService); app.component(“vue3-snackbar”, Vue3Snackbar); app.mount(“#app”); 2. Add the vue3-snackbar component to the app.vue. <vue3-snackbar bottom right :duration=”5000″> </vue3-snackbar> // Options API export default { methods: { successMessage() { this.$snackbar.add({ type: ‘success’, text: ‘This is a success message’ }) } } } // Composition API import