Gathering detailed insights and metrics for vue-sweetalert2
Gathering detailed insights and metrics for vue-sweetalert2
Gathering detailed insights and metrics for vue-sweetalert2
Gathering detailed insights and metrics for vue-sweetalert2
nuxt-sweetalert2
A minimal sweetalert2 module based on vue-sweetalert2 with global options
vue-simple-alert
Simple alert(), confirm(), prompt() for Vue.js, using sweetalert2.
nuxtjs-sweetalert2
A minimal sweetalert2 module based on vue-sweetalert2 with global options
sweetalert2-mod
Sweetalert2 with custom styles
npm install vue-sweetalert2
Typescript
Module System
Node Version
NPM Version
84
Supply Chain
99.6
Quality
76.1
Maintenance
50
Vulnerability
100
License
TypeScript (36.54%)
CSS (25.07%)
JavaScript (16.75%)
Vue (13.47%)
Shell (4.26%)
HTML (3.91%)
Total Downloads
10,810,527
Last Day
1,555
Last Week
42,869
Last Month
188,630
Last Year
2,274,877
668 Stars
238 Commits
78 Forks
7 Watchers
2 Branches
16 Contributors
Updated on Jun 25, 2025
Minified
Minified + Gzipped
Latest Version
5.0.11
Package Id
vue-sweetalert2@5.0.11
Unpacked Size
157.10 kB
Size
46.70 kB
File Count
17
NPM Version
10.5.0
Node Version
18.20.2
Published on
Jun 04, 2024
Cumulative downloads
Total Downloads
Last Day
-11.1%
1,555
Compared to previous day
Last Week
-9%
42,869
Compared to previous week
Last Month
4.8%
188,630
Compared to previous month
Last Year
-2%
2,274,877
Compared to previous year
1
1
Vue.js wrapper for SweetAlert2. With support SSR.
When using "Vue3: Composition API" it is better not to use this wrapper. It is more practical to call sweetalert2 directly.
Also, it is better to do it to get feedback faster, and be closer to the documentation.
1npm install -S vue-sweetalert2
1{ 2 //...tsconfig.json 3 "types": [ 4 "vue-sweetalert2" 5 ], 6}
1// main.js 2import Vue from 'vue'; 3import VueSweetalert2 from 'vue-sweetalert2'; 4 5// If you don't need the styles, do not connect 6import 'sweetalert2/dist/sweetalert2.min.css'; 7 8Vue.use(VueSweetalert2);
1// main.js 2import { createApp } from 'vue' 3import App from './App.vue' 4import './index.css' 5 6import VueSweetalert2 from 'vue-sweetalert2'; 7import 'sweetalert2/dist/sweetalert2.min.css'; 8 9const app = createApp(App) 10 11app.use(VueSweetalert2); 12 13app.mount('#app');
Now in the global object, you can access all the methods of sweetalert2.
1// example-vue-component.vue 2<template> 3 <button @click="showAlert">Hello world</button> 4</template> 5 6<script> 7export default { 8 methods: { 9 showAlert() { 10 // Use sweetalert2 11 this.$swal('Hello Vue world!!!'); 12 }, 13 }, 14}; 15</script>
// Or
1Vue.swal('Hello Vue world!!!');
If you want to add global options like button colors, do something like this:
1// main.js 2import Vue from 'vue'; 3import VueSweetalert2 from 'vue-sweetalert2'; 4 5const options = { 6 confirmButtonColor: '#41b882', 7 cancelButtonColor: '#ff7674', 8}; 9 10Vue.use(VueSweetalert2, options);
Using scss styles are loaded so
1// main.js 2import Vue from 'vue'; 3import VueSweetalert2 from 'vue-sweetalert2'; 4 5Vue.use(VueSweetalert2);
1// style.scss 2@import '~sweetalert2/src/variables'; 3 4$swal2-background: #990000; 5 6@import '~sweetalert2/src/sweetalert2';
Install dependencies:
1npm install -S vue-sweetalert2
Add vue-sweetalert2/nuxt
to modules section of nuxt.config.js
1{ 2 modules: ['vue-sweetalert2/nuxt']; 3}
Or pass in global options like this:
1{ 2 modules: [ 3 'vue-sweetalert2/nuxt', 4 ], 5 sweetalert: { 6 confirmButtonColor: '#41b882', 7 cancelButtonColor: '#ff7674' 8 } 9}
Add vue-sweetalert2/nuxt
to modules section of nuxt.config.js
1{ 2 // Before doing so, install the "@sweetalert2/theme-dark" 3 css: [ '@sweetalert2/theme-dark' ], 4 modules: ['vue-sweetalert2/nuxt/no-css']; 5}
sweetalert2
, you can find here.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
Found 1/23 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More