Gathering detailed insights and metrics for @conciergerie.dev/vue-toaster
Gathering detailed insights and metrics for @conciergerie.dev/vue-toaster
npm install @conciergerie.dev/vue-toaster
Typescript
Module System
Node Version
NPM Version
73.7
Supply Chain
98.9
Quality
79.1
Maintenance
100
Vulnerability
100
License
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
16,691
Last Day
95
Last Week
473
Last Month
1,157
Last Year
12,832
Minified
Minified + Gzipped
Latest Version
2.4.5-1
Package Id
@conciergerie.dev/vue-toaster@2.4.5-1
Unpacked Size
44.39 kB
Size
13.18 kB
File Count
22
NPM Version
10.5.0
Node Version
20.12.1
Published on
Apr 05, 2024
Cumulative downloads
Total Downloads
Last Day
239.3%
95
Compared to previous day
Last Week
408.6%
473
Compared to previous week
Last Month
-20.4%
1,157
Compared to previous month
Last Year
308.3%
12,832
Compared to previous year
1
Vue.js toast notification plugin for vue 3
1# yarn 2yarn add @conciergerie.dev/vue-toaster 3 4# npm 5npm install --save-dev @conciergerie.dev/vue-toaster
You can install Toaster so it's usable globally:
1// In you main.js 2import Toaster from "@conciergerie.dev/vue-toaster"; 3 4createApp(App).use(Toaster).mount("#app");
You can also import Toaster locally:
1import { createToaster } from "@conciergerie.dev/vue-toaster"; 2 3const toaster = createToaster({ /* options */ }); 4 5toaster.show(`Hey! I'm here`);
1// this.$toast.show(message, {/* options */}); 2this.$toast.show(`Hey! I'm here`); 3this.$toast.success(`Hey! I'm here`); 4this.$toast.error(`Hey! I'm here`); 5this.$toast.warning(`Hey! I'm here`); 6this.$toast.info(`Hey! I'm here`); 7 8// Close all opened toast after 3000ms 9setTimeout(this.$toast.clear, 3000);
The API methods accepts these options:
Attribute | Type | Default | Description |
---|---|---|---|
message | String | -- | Message text/html (required) |
type | String | default | One of success , info , warning , error , default |
position | String | bottom-right | One of top , bottom , top-right , bottom-right ,top-left , bottom-left |
duration | Number or false | 4000 | Visibility duration in milliseconds or false that disables duration |
dismissible | Boolean | true | Allow user close by clicking |
onClick | Function | -- | Do something when user clicks |
onClose | Function | -- | Do something after toast gets dismissed |
queue | Boolean | false | Wait for existing to close before showing new |
maxToasts | Number or false | false | Defines the max of toasts showed in simultaneous |
pauseOnHover | Boolean | true | Pause the timer when mouse on over a toast |
useDefaultCss | Boolean | true | User default css styles |
show(message, ?options)
This is generic method, you can use this method to make any kind of toast.
1// Can accept a message as string and apply rest of options from defaults 2this.$toast.show("Howdy!"); 3 4// Can accept an Object of options. 5// If yout don't pass options, the default toast will be showed 6this.$toast.show("Something went wrong!", { 7 type: "error", 8 // all of other options may go here 9});
success(message,?options)
There are some proxy methods to make it more readable. The same rule for error
, info
and warning
methods
1this.$toast.success("Profile saved.", { 2 // optional options Object 3});
You can set options for all the instances during plugin initialization
1app.use(Toaster, { 2 // One of the options 3 position: "top", 4});
Further you can override option when creating new instances
1this.$toast.success("Order placed.", { 2 // override the global option 3 position: "bottom", 4});
Clone the project and run:
cd vue-toaster-example
npm install
npm run dev
MIT License
No vulnerabilities found.
No security vulnerabilities found.