Saturday, 19 March 2022

sweet alert react js

 

  1. npm install --save sweetalert2 sweetalert2-react-content  

import Swal from "sweetalert2"

  1.  Swal.fire({  
  2.       title: 'Success',  
  3.       type: 'success',  
  4.       text: 'Your work has been saved.',  
  5.     });  
  1.  Swal.fire({  
  2.       title: 'Are you sure?',  
  3.       text: 'User will have Admin Privileges',  
  4.       icon: 'warning',  
  5.       showCancelButton: true,  
  6.       confirmButtonColor: '#3085d6',  
  7.       cancelButtonColor: '#d33',  
  8.       confirmButtonText: 'Yes!'  
  9.     });  
  1.  Swal.fire({  
  2.       icon: 'error',  
  3.       title: 'Oops...',  
  4.       text: 'Something went wrong!',  
  5.       footer: '<a href>Why do I have this issue?</a>'  
  6.     });  
  7.  Swal.fire({  
  8.       position: 'top-end',  
  9.       icon: 'success',  
  10.       title: 'Your work has been saved',  
  11.       showConfirmButton: false,  
  12.       timer: 1500  
  13.     });  

No comments:

Post a Comment

Car pooling app

 I'll create a car pooling app with real-time vehicle tracking, pickup/drop time estimates, and a list of onboard users. Since we don...