HTML
Sweetalert
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>swal("My title", "My description", "success");</script>
sweet alert bootstrap1
swal("Good job!", "You clicked the button!", "error")
sweetalert
Swal.fire({
position: 'top-end',
icon: 'success',
title: 'Your work has been saved',
showConfirmButton: false,
timer: 1500
})
sweetalert
Swal.fire({
position: 'top-end',
icon: 'success',
title: 'Your work has been saved',
showConfirmButton: false,
timer: 1500
})
success sweet alert
Swal.fire({
title: 'Custom animation with Animate.css',
icon: 'success',
showClass: {
popup: 'animate__animated animate__fadeInDown'
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp'
}
})
bootstrap sweetalert
swal("Good job!", "You clicked the button!", "success")
sweet alert bootstrap
Swal.fire( 'Good job!', 'You clicked the button!', 'success')
SweetAlert
Swal.fire({
title: 'هل تريد الاستمرار؟',
icon: 'question',
iconHtml: '؟',
confirmButtonText: 'نعم',
cancelButtonText: 'لا',
showCancelButton: true,
showCloseButton: true
})
sweet alert bootstrap
swal("Thank you!", "We will get back to you if required", "success");
sweet alert bootstrap
Swal.fire({ icon: 'success', title: 'Oops...', text: 'Something went wrong!', footer: '<a href>Why do I have this issue?</a>'})
sweetalert
Swal.fire({
title: 'Custom animation with Animate.css',
showClass: {
popup: 'animate__animated animate__fadeInDown'
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp'
}
})
sweetalert
swal("Good job!", "success");
sweetalert
Swal.fire({
imageUrl: 'https://placeholder.pics/svg/300x1500',
imageHeight: 100,
imageAlt: 'A tall image'
})
sweetalert
swal("Good job!", "You clicked the button!", "error");
sweetalert
swal("Good job!", "You clicked the button!", "success");
sweetalert
// reactjs codeto browse and upload an image from your device
const addImage =async() => {
const { value: file } = await Swal.fire({
title: 'Select image',
input: 'file',
inputAttributes: {
'accept': 'image/*',
'aria-label': 'Upload your profile picture'
}
})
if (file) {
const reader = new FileReader()
reader.onload = (e) => {
Swal.fire({
title: 'Your uploaded picture',
imageUrl: e.target.result,
imageAlt: 'The uploaded picture'
}
)
console.log(e.target.result);
}
reader.readAsDataURL(file)
}
sweetalert
swal({ icon: "success",});
sweetalert to small bootstrap
.swal2-popup {
font-size: 1.6rem !important;
}
sweetalert
<script src="//cdn.jsdelivr.net/npm/sweetalert2@10"></script>