:shipit: The author of SweetAlert2 (@limonte) is looking for short-term to medium-term working contracts in front-end, preferably OSS.
👉 Upgrading from v9.x to v10.x? Read the release notes!
If you're upgrading from v8.x, please upgrade from v8 to v9 first!
If you're upgrading from v7.x, please upgrade from v7 to v8 first!
If you're upgrading from v6.x, please upgrade from v6 to v7 first!
npm install --save sweetalert2
Or grab from jsdelivr CDN :
<!-- Include a polyfill for ES6 Promises (optional) for IE11 -->
You can also include the stylesheet separately if desired:
// ES6 Modules or TypeScript// CommonJSconst Swal =
Or with JS modules:
It's possible to import JS and CSS separately, e.g. if you need to customize styles:
Please note that TypeScript is well-supported, so you don't have to install a third-party declaration file.
The most basic message:
A message signaling an error:
Handling the result of SweetAlert2 modal:
* ES6 Promise polyfill should be included, see usage example.
Note that SweetAlert2 does not and will not provide support or functionality of any kind on IE10 and lower.
- ngx-sweetalert2 - Angular 4+ integration
- sweetalert2-react-content - React integration
- sweetalert2-webpack-demo - webpack demo
- sweetalert2-parcel-demo - overriding SCSS variables demo
Related community projects
- avil13/vue-sweetalert2 - Vue.js wrapper
- realrashid/sweet-alert - Laravel 5 Package
- Basaingeal/Razor.SweetAlert2 - Blazor Wrapper
- ElectronAlert - SweetAlert2 for Electron applications (main process)
If you would like to contribute enhancements or fixes, please do the following:
sweetalert2repository and clone it locally.
When in the SweetAlert2 directory, run
yarn installto install dependencies.
To begin active development, run
yarn start. This does several things for you:
- Builds the
- Serves sandbox.html @ http://localhost:8080/ (browser-sync ui: http://localhost:8081/)
- Re-builds and re-loads as necessary when files change
- Serena Verni (@serenaperora) for creating the amazing project logo
- Sauce Labs for providing the reliable cross-browser testing platform
|Become a sponsor||FlowCrypt||brainbi price monitoring||Tiago de Oliveira Stutz|
|Zilla Themes||SebaEBC||WP Reset|
|STED||Sextopedia||My Sex Toy Guide||Best Blowjob Machines||YourDoll|
Support and Donations
Has SweetAlert2 helped you create an amazing application? You can show your support via GitHub Sponsors
Alternative ways for donations (PayPal, cryptocurrencies, etc.) are listed here: https://sweetalert2.github.io/#donations