SweetAlert2 provides beautiful, responsive, customizable popup boxes. Oorian's wrapper makes it easy to show alerts, confirmations, and toasts.
Basic Alerts
SwalAlert.success("Success!", "Your changes have been saved.");
SwalAlert.error("Error", "Something went wrong.");
SwalAlert.warning("Warning", "Are you sure you want to proceed?");
Confirmation Dialogs
SwalAlert.confirm("Delete?", "This action cannot be undone.")
.onConfirm(() -> {
deleteItem();
refreshList();
})
.onCancel(() -> {
// User cancelled
})
.show();
Toast Notifications
SwalToast.success("Item saved")
.setPosition(Position.TOP_END)
.setTimer(3000)
.show();
Conclusion
SweetAlert2 replaces browser alerts with beautiful, customizable popups that enhance user experience.