Solution 1 :

iconColor works for me when trying it in CodePen – It appears this was added in SweetAlert2 10.1.10 (, and made an updatable param in 10.2.0 (

Are you running a version of sweetalert2 later than these? 🙂

Problem :

I am following the documentation and it is working wonders. However, using the iconColor property
I get this error in the console: SweetAlert2: Unknown parameter "iconColor". How can I easily change the color of the icon? I could change the color using customClass, but I would prefer to use iconColor as shown in the documentation.


function Delete(e) {
                title: "Do you want to delete?",
                text: " You will not be able to undo after deletion",
                icon: "warning",
                iconColor: "#000",
                showCancelButton: true,
                focusCancel: true,
                confirmButtonColor: '#d33',
                confirmButtonText: 'Yes, delete!',
                cancelButtonColor: '#3085d6',
                cancelButtonText: 'Cancel',
            }).then((result) => {
                if (result.isConfirmed) {
<link href="[email protected]/dist/sweetalert2.min.css" rel="stylesheet"/>
<script src="[email protected]/dist/sweetalert2.all.min.js"></script>
<button onclick="Delete(this)" type="button" class="btn btn-sm btn-danger mt-2">Delete</button>


Comment posted by

Comment posted by Sondre

Thank you! I made a dummy mistake of grabbing the v9.17.2 version, assuming the latest version would be displayed on jsdelivr.. (got the files from “top 5 files”)