</> ConvertAtlas Developer Tools
Bootstrap 5 · Beginner

Copy-to-Clipboard Field

A read-only field with a copy button that confirms on click.

Requires Bootstrap 5. 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>
<div class="card border-0 shadow-sm" style="max-width:380px"><div class="card-body">
  <label class="form-label small fw-semibold">API key</label>
  <div class="input-group"><input class="form-control" id="cfInput" value="sk_live_8f3k2j9d" readonly><button class="btn btn-primary" id="cfBtn">Copy</button></div>
</div></div>
var b=document.getElementById('cfBtn'),i=document.getElementById('cfInput');
b.onclick=function(){navigator.clipboard&&navigator.clipboard.writeText(i.value);b.textContent='Copied!';b.classList.replace('btn-primary','btn-success');setTimeout(function(){b.textContent='Copy';b.classList.replace('btn-success','btn-primary')},1400)};
Free to use.This component uses Bootstrap 5 (linked above). Copy any file, or download a ready-to-open .html page with the CDN links already included.