</> ConvertAtlas Developer Tools
Bootstrap 5 · Advanced

2FA QR Setup

A 2FA setup card with an otpauth QR and a confirm alert.

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-sm text-center" style="max-width:300px"><div class="card-body">
  <h6 class="fw-bold">2FA setup</h6>
  <p class="small text-secondary mb-2">Scan with your authenticator app</p>
  <div id="nqQr" class="d-inline-block mb-2"></div>
  <button class="btn btn-primary btn-sm w-100" id="nqDone">I've scanned it</button>
</div></div>
new QRCode(document.getElementById('nqQr'),{text:'otpauth://totp/ConvertAtlas:user?secret=JBSWY3DPEHPK3PXP',width:130,height:130});
document.getElementById('nqDone').onclick=function(){Swal.fire({icon:'success',title:'2FA enabled!',timer:1800,showConfirmButton:false})};
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.