<!doctype html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
@import url('https://fonts.googleapis.com/css?family=Montserrat');
* {
font-family: Montserrat, sans-serif;
}
</style>
</head>
<body>
<script type="module">
import '../src/sweetalert2.scss'
import Swal from '../src/sweetalert2.js'
window.Swal = Swal
Swal.fire({
title: 'Test modal with input',
html: 'custom <strong>content</strong>',
input: 'text',
icon: 'success',
showCloseButton: true,
showCancelButton: true,
inputValidator: (value) => {
if (!value) {
return 'Should not be empty!'
}
},
didOpen: (modal) => {
console.log(modal)
},
}).then((result) => {
console.log(result)
})
</script>
</body>
</html>