QR Ticket Card
A ticket card with a QR code and an add-to-wallet toast.
Requires Bootstrap 5, QRCode.js, SweetAlert2. Add the CDN tags below to your page (styles in
<head>, scripts before </body>). The downloaded file already includes them.<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script><script src="https://cdn.jsdelivr.net/npm/qrcodejs@1.0.0/qrcode.min.js"></script><script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script><div class="card border-0 shadow text-center" style="max-width:300px"><div class="card-body">
<h6 class="fw-bold">Your ticket</h6><p class="small text-secondary mb-2">Show this at the entrance</p>
<div id="tkQr" class="d-inline-block"></div>
<button class="btn btn-sm btn-primary mt-2 w-100" id="tkBtn">Add to wallet</button>
</div></div>new QRCode(document.getElementById('tkQr'),{text:'TICKET-8F3K-2026',width:130,height:130});
document.getElementById('tkBtn').onclick=function(){Swal.fire({toast:true,position:'top-end',icon:'success',title:'Added to wallet',showConfirmButton:false,timer:1800})};Free to use.This component uses Bootstrap 5, QRCode.js, SweetAlert2 (linked above). Copy any file, or download a ready-to-open .html page with the CDN links already included.