Heartbeat
A copy-paste loaders component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
LoadersHTMLCSSany framework
Copy into your project
HTML
<!-- Heartbeat Loader -->
<div class="nuda-heartbeat" role="status" aria-label="Loading">
<svg viewBox="0 0 120 40" width="120" height="40">
<polyline
class="nuda-heartbeat__line"
points="0,20 20,20 30,20 38,5 45,35 52,15 58,20 80,20 90,20 98,5 105,35 112,15 118,20 120,20"
fill="none"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>CSS
/* Heartbeat Loader
ECG heartbeat line animation using SVG stroke-dashoffset.
Customize: --heartbeat-color, --heartbeat-stroke */
.nuda-heartbeat {
--heartbeat-color: #ef4444;
--heartbeat-stroke: 2;
padding: 8px;
display: flex;
align-items: center;
}
.nuda-heartbeat__line {
stroke: var(--heartbeat-color);
stroke-width: var(--heartbeat-stroke);
stroke-dasharray: 200;
stroke-dashoffset: 200;
animation: nuda-heartbeat 2s linear infinite;
}
@keyframes nuda-heartbeat {
0% { stroke-dashoffset: 200; }
100% { stroke-dashoffset: -200; }
}
@media (prefers-reduced-motion: reduce) {
.nuda-heartbeat__line {
animation: none;
stroke-dashoffset: 0;
opacity: 0.6;
}
}How to use Heartbeat
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.