Ripple Click Spark
A copy-paste cursors component in pure HTML, CSS & vanilla JS. Zero dependencies, framework-agnostic, MIT-licensed.
CursorsHTMLJavaScriptCSSany framework
Copy into your project
HTML
<button type="button" class="nuda-cur2-ripple-spark">
<span class="nuda-cur2-ripple-spark__label">Click me</span>
</button>JavaScript
/* Ripple Click Spark — spawns a fading ring at the click point. */
(function () {
document.querySelectorAll('.nuda-cur2-ripple-spark').forEach(function (btn) {
btn.addEventListener('click', function (e) {
var rect = btn.getBoundingClientRect();
var ring = document.createElement('span');
ring.className = 'nuda-cur2-ripple-spark__ring';
ring.style.left = (e.clientX - rect.left) + 'px';
ring.style.top = (e.clientY - rect.top) + 'px';
btn.appendChild(ring);
ring.addEventListener('animationend', function () {
ring.remove();
});
});
});
})();CSS
.nuda-cur2-ripple-spark {
position: relative;
overflow: hidden;
min-width: 120px;
min-height: 44px;
padding: 0 20px;
border-radius: 10px;
border: 1px solid rgba(228,255,84,.3);
background: #161616;
color: #fafafa;
font-size: 13px;
font-weight: 600;
cursor: pointer;
isolation: isolate;
}
.nuda-cur2-ripple-spark__label {
position: relative;
z-index: 1;
}
.nuda-cur2-ripple-spark__ring {
position: absolute;
width: 8px;
height: 8px;
border-radius: 50%;
background: radial-gradient(circle,rgba(228,255,84,.9),rgba(228,255,84,0) 70%);
transform: translate(-50%,-50%) scale(1);
pointer-events: none;
animation: _nuda-cur2ripplespark .6s ease-out forwards;
}
@keyframes _nuda-cur2ripplespark {
to {
transform: translate(-50%,-50%) scale(14);
opacity: 0;
}
}
.nuda-cur2-ripple-spark:focus-visible {
outline: 2px solid #e4ff54;
outline-offset: 3px;
}
@media (prefers-reduced-motion:reduce) {
.nuda-cur2-ripple-spark__ring {
animation: none;
display: none;
}
}
How to use Ripple Click Spark
Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.
Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.