Sweetalert2
Overview Official Website
A beautiful, responsive, customizable, accessible (WAI-ARIA) replacement for JavaScript's popup boxes.
CSS
<!-- Sweet Alert css-->
<link href="{{url_for('static' ,filename='libs/sweetalert2/sweetalert2.min.css')}}" rel="stylesheet" type="text/css" />
Javascript
<!-- Sweet Alerts js -->
<script src="{{url_for('static' ,filename='libs/sweetalert2/sweetalert2.min.js')}}"></script>
Initjs (Custom js)
<!-- Sweet alert init js-->
<script src="{{url_for('static' ,filename='js/pages/sweetalerts.init.js')}}"></script>
Add Package
yarn add sweetalert2 --save
Remove Package
yarn remove sweetalert2 or you can remove package by removing specific package from package.json .
Examples
Title | Javascript |
---|---|
A Basic Message |
|
A Title with a Text Under |
|
A Success message! |
|
A Modal with a title, an error icon, a text, and a footer |
|
A Modal window with a long content inside |
|
A Warning message, with a function attached to the "Confirm"-button... |
|
By passing a parameter, you can execute something else for "Cancel". |
|
A message with custom Image Header. |
|
A message with auto close timer. |
|
Custom HTML description and buttons. |
|
A dialog with three buttons. |
|
A custom positioned dialog. |
|
A message with custom width, padding and background. |
|
Ajax request example. |
|
Custom Sweetalert Example
Title | Javascript |
---|---|
Success Message |
|
Error Message |
|
Warning Message |
|
Join Our Community |
|
Email Verification |
|
Notification Message |
|