{"_id":"@devzatokio/vue-toaster","name":"@devzatokio/vue-toaster","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@devzatokio/vue-toaster","version":"0.0.1","description":"Vue.js toaster notification","main":"src/index.js","exports":{".":{"import":"./src/index.js"}},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/DevZatokio/vue-toaster.git"},"keywords":["toast","toaster","notification","vue","vue3","toastify"],"author":{"name":"@devzatokio"},"license":"MIT","bugs":{"url":"https://github.com/DevZatokio/vue-toaster/issues"},"homepage":"https://github.com/DevZatokio/vue-toaster#readme","dependencies":{"stylus":"~0.54.8","stylus-loader":"~3.0.2"},"gitHead":"3394141c5077166f2cba831c0017d187bd162ff7","_id":"@devzatokio/vue-toaster@0.0.1","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-tX+CJTiew+74Te8UN9+XlnWD76Xqdj5SXJsb8k7Gshk50hAj+aXgAyzrQwx0/oM/mjfWilWXu8y9x6vip28mvA==","shasum":"356c3f05c76147f4c9685b59575022434ff96a29","tarball":"https://registry.npmjs.org/@devzatokio/vue-toaster/-/vue-toaster-0.0.1.tgz","fileCount":18,"unpackedSize":16055,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPTNIw4/n5uMVTzpwdy9b6bkfONc1ti0K7sAbCXdH9sgIhAPfoB0qocaT5a+ztEn1fxvQcPS3hyG6ulJqZixUo18VW"}]},"_npmUser":{"name":"devzatokio","email":"srcarmi@gmail.com"},"directories":{},"maintainers":[{"name":"devzatokio","email":"srcarmi@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-toaster_0.0.1_1701130746281_0.5942838740218697"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-28T00:19:06.150Z","0.0.1":"2023-11-28T00:19:06.437Z","modified":"2023-11-28T00:19:06.668Z"},"maintainers":[{"name":"devzatokio","email":"srcarmi@gmail.com"}],"description":"Vue.js toaster notification","homepage":"https://github.com/DevZatokio/vue-toaster#readme","keywords":["toast","toaster","notification","vue","vue3","toastify"],"repository":{"type":"git","url":"git+https://github.com/DevZatokio/vue-toaster.git"},"author":{"name":"@devzatokio"},"bugs":{"url":"https://github.com/DevZatokio/vue-toaster/issues"},"license":"MIT","readme":"# Vue Toaster\n\nVue.js toast notification plugin for vue 3\n\n## Installation\n\n```bash\n# yarn\nyarn add @devzatokio/vue-toaster\n\n# npm\nnpm install @devzatokio/vue-toaster\n```\n\n## Import\n\nYou can install Toaster so it's usable globally:\n\n```js\n// In you main.js\n// ... considering that your app creation is here\nimport Toaster from \"@devzatokio/vue-toaster\";\n\ncreateApp(App).use(Toaster).mount(\"#app\");\n```\n\nYou can also import Toaster locally:\n\n```js\nimport { createToaster } from \"@devzatokio/vue-toaster\";\n\nconst toaster = createToaster({ /* options */ });\n\ntoaster.show(`Hey! I'm here`);\n```\n\n## Usage\n\n```js\n// this.$toast.show(message, {/* options */});\nthis.$toast.show(`Hey! I'm here`);\nthis.$toast.success(`Hey! I'm here`);\nthis.$toast.error(`Hey! I'm here`);\nthis.$toast.warning(`Hey! I'm here`);\nthis.$toast.info(`Hey! I'm here`);\n\n// Close all opened toast after 3000ms\nsetTimeout(this.$toast.clear, 3000);\n```\n\n## Available options\n\nThe API methods accepts these options:\n\n| Attribute     |      Type       |    Default     | Description                                                                   |\n| :------------ | :-------------: | :------------: | :---------------------------------------------------------------------------- |\n| message       |     String      |       --       | Message text/html (required)                                                  |\n| type          |     String      |   `default`    | One of `success`, `info`, `warning`, `error`, `default`                       |\n| position      |     String      | `bottom-right` | One of `top`, `bottom`, `top-right`, `bottom-right`,`top-left`, `bottom-left` |\n| duration      | Number or false |     `4000`     | Visibility duration in milliseconds or `false` that disables duration         |\n| dismissible   |     Boolean     |     `true`     | Allow user close by clicking                                                  |\n| onClick       |    Function     |       --       | Do something when user clicks                                                 |\n| onClose       |    Function     |       --       | Do something after toast gets dismissed                                       |\n| queue         |     Boolean     |    `false`     | Wait for existing to close before showing new                                 |\n| maxToasts     | Number or false |    `false`     | Defines the max of toasts showed in simultaneous                              |\n| pauseOnHover  |     Boolean     |     `true`     | Pause the timer when mouse on over a toast                                    |\n| useDefaultCss |     Boolean     |     `true`     | User default css styles                                                       |\n\n## API methods\n\n### `show(message, ?options)`\n\nThis is generic method, you can use this method to make any kind of toast.\n\n```js\n// Can accept a message as string and apply rest of options from defaults\nthis.$toast.show(\"Howdy!\");\n\n// Can accept an Object of options.\n// If yout don't pass options, the default toast will be showed\nthis.$toast.show(\"Something went wrong!\", {\n  type: \"error\",\n  // all of other options may go here\n});\n```\n\n### `success(message,?options)`\n\nThere are some proxy methods to make it more readable. The same rule for `error`, `info` and `warning` methods\n\n```js\nthis.$toast.success(\"Profile saved.\", {\n  // optional options Object\n});\n```\n\n## Global options\n\nYou can set options for all the instances during plugin initialization\n\n```js\napp.use(Toaster, {\n  // One of the options\n  position: \"top\",\n});\n```\n\nFurther you can override option when creating new instances\n\n```js\nthis.$toast.success(\"Order placed.\", {\n  // override the global option\n  position: \"bottom\",\n});\n```\n\n## How to execute example\n\nClone the project and run:\n\n```\ncd example; yarn install; yarn serve\n```\n\n## License\n\n[MIT](LICENSE.txt) License\n","readmeFilename":"README.md"}