Kopieerknop
A copy button next to an account number: after a click the icon redraws itself into a check mark, the button turns green and after two seconds it all returns. Includes a fallback when clipboard access is refused.
Stichting De Brug, Rotterdam
NL91 ABNA 0417 1643 00
How to use it
- Paste the HTML where the buttons should appear.
- Add the CSS to your stylesheet. All classes are prefixed, so nothing clashes with your own styles.
- Add the JavaScript and call init() with the element that contains the HTML.
<!-- Kopieerknop · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<div class="h3cp">
<div class="h3cp-kaart">
<p class="h3cp-wie">Stichting De Brug, Rotterdam</p>
<div class="h3cp-rij">
<span class="h3cp-waarde">NL91 ABNA 0417 1643 00</span>
<button class="h3cp-btn" type="button" aria-label="Kopieer rekeningnummer">
<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<g class="h3cp-i-kopie"><rect x="8" y="8" width="12" height="12" rx="2.5"/><path d="M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"/></g>
<path class="h3cp-i-vink" d="M5 12.5l4.5 4.5L19.5 7"/>
</svg>
<span class="h3cp-txt">Kopieer</span>
</button>
</div>
</div>
<p class="h3cp-live" aria-live="polite"></p>
</div>
</div>/* Kopieerknop · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie */
/* fonts (Fontshare): switzer@400,500,600 */
.h3cp{width:100%;height:100%;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:16px;background:#e8ecef;font-family:Switzer,sans-serif;color:#171717}
.h3cp-kaart{width:min(100%,440px);box-sizing:border-box;padding:18px 18px 18px 20px;border-radius:4px;background:#fff;border:1px solid #dedcd6}
.h3cp-wie{margin:0 0 8px;font:400 14px/1.3 Switzer,sans-serif;color:#5d5d5d}
.h3cp-rij{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.h3cp-waarde{font:600 clamp(16px,4.6vw,19px)/1.2 Switzer,sans-serif;font-variant-numeric:tabular-nums;letter-spacing:.01em}
.h3cp-btn{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 14px;border-radius:4px;border:1px solid #171717;background:#171717;color:#fff;font:500 14px/1 Switzer,sans-serif;cursor:pointer;transition:background .3s ease,border-color .3s ease,transform .15s ease}
.h3cp-btn:hover{background:#333;border-color:#333}
.h3cp-btn:active{transform:scale(.96)}
.h3cp-btn:focus-visible{outline:2px solid #F5480F;outline-offset:3px}
.h3cp-btn svg{overflow:visible}
.h3cp-i-kopie{transform-origin:12px 12px;transition:transform .35s cubic-bezier(.5,0,.3,1),opacity .25s ease}
.h3cp-i-vink{stroke-dasharray:22;stroke-dashoffset:22;transition:stroke-dashoffset .4s cubic-bezier(.6,0,.2,1) .12s}
.h3cp-btn.is-ok{background:#1d7a4b;border-color:#1d7a4b}
.h3cp-btn.is-ok .h3cp-i-kopie{transform:scale(.4) rotate(-25deg);opacity:0}
.h3cp-btn.is-ok .h3cp-i-vink{stroke-dashoffset:0}
.h3cp-live{margin:0;min-height:1.3em;font:400 13px/1.3 Switzer,sans-serif;color:#5d5d5d}
@media (prefers-reduced-motion:reduce){.h3cp-i-kopie,.h3cp-i-vink,.h3cp-btn{transition:none}}// Kopieerknop · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie
// root = het element waarin de HTML staat
function init(root){
var btn = root.querySelector('.h3cp-btn'), txt = root.querySelector('.h3cp-txt'), live = root.querySelector('.h3cp-live'), waarde = root.querySelector('.h3cp-waarde');
var timer = 0;
function oud(s) {
var ta = document.createElement('textarea'); ta.value = s; ta.setAttribute('readonly', '');
ta.style.position = 'absolute'; ta.style.left = '-9999px'; root.appendChild(ta); ta.select();
var ok = false; try { ok = document.execCommand('copy'); } catch (e) {}
ta.remove(); return ok;
}
function klaar(ok) {
clearTimeout(timer);
if (ok) { btn.classList.add('is-ok'); txt.textContent = 'Gekopieerd'; live.textContent = 'Rekeningnummer staat op je klembord.'; }
else {
live.textContent = 'Kopiëren lukte niet, het nummer is geselecteerd.';
var r = document.createRange(); r.selectNodeContents(waarde); var sel = getSelection(); sel.removeAllRanges(); sel.addRange(r);
}
timer = setTimeout(function () { btn.classList.remove('is-ok'); txt.textContent = 'Kopieer'; live.textContent = ''; }, 2000);
}
btn.addEventListener('click', function () {
var s = waarde.textContent.replace(/\s+/g, '');
if (navigator.clipboard && window.isSecureContext) navigator.clipboard.writeText(s).then(function () { klaar(true); }, function () { klaar(oud(s)); });
else klaar(oud(s));
});
}
init(document.querySelector('.jouw-container'));
More buttons
Seen something you like?
Add it to your selection and send it over. We build your site around it, in your brand.
Get in touch →