Download to Done
A copy-paste animated icons component in pure HTML, CSS & vanilla JS. Zero dependencies, framework-agnostic, MIT-licensed.
Animated IconsHTMLCSSJavaScriptany framework
Copy into your project
HTML
<button class="nuda-icon-download" type="button" aria-label="Download" aria-pressed="false">
<svg class="nuda-icon-download__svg" viewBox="0 0 24 24" aria-hidden="true">
<line class="nuda-icon-download__base" x1="5" y1="20" x2="19" y2="20" />
<g class="nuda-icon-download__arrow">
<line x1="12" y1="4" x2="12" y2="15" />
<polyline points="7 11 12 16 17 11" />
</g>
<polyline class="nuda-icon-download__check" points="6 12 10 16 18 7" />
</svg>
</button>CSS
/* Download to Done
Arrow drops away, baseline collapses, then a checkmark draws in.
GPU-only: transform + opacity + dashoffset. Customize: --icon-accent */
.nuda-icon-download {
--icon-accent: #e4ff54;
display: inline-flex;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
background: #09090b;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 10px;
color: #fafafa;
cursor: pointer;
transition: border-color 0.25s, color 0.25s;
}
.nuda-icon-download:hover,
.nuda-icon-download:focus-visible {
border-color: rgba(228, 255, 84, 0.4);
outline: none;
}
.nuda-icon-download:focus-visible {
box-shadow: 0 0 0 2px rgba(228, 255, 84, 0.5);
}
.nuda-icon-download[aria-pressed="true"] { color: var(--icon-accent); }
.nuda-icon-download__svg {
width: 24px;
height: 24px;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
fill: none;
}
.nuda-icon-download__arrow,
.nuda-icon-download__base {
transition: transform 0.35s cubic-bezier(0.4, 0.2, 0.2, 1), opacity 0.25s;
transform-origin: center;
will-change: transform, opacity;
}
.nuda-icon-download__check {
stroke-dasharray: 24;
stroke-dashoffset: 24;
opacity: 0;
transition: stroke-dashoffset 0.4s ease 0.15s, opacity 0.2s 0.15s;
}
.nuda-icon-download[aria-pressed="true"] .nuda-icon-download__arrow {
opacity: 0;
transform: translateY(8px) scale(0.6);
}
.nuda-icon-download[aria-pressed="true"] .nuda-icon-download__base {
opacity: 0;
transform: scaleX(0.4);
}
.nuda-icon-download[aria-pressed="true"] .nuda-icon-download__check {
opacity: 1;
stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: reduce) {
.nuda-icon-download__arrow,
.nuda-icon-download__base,
.nuda-icon-download__check { transition: opacity 0.25s; }
}JavaScript
/* Download to Done — vanilla JS
Marks pressed, shows the check, reverts after 1.8s. */
(function () {
document.querySelectorAll(".nuda-icon-download").forEach(function (btn) {
btn.addEventListener("click", function () {
if (btn.getAttribute("aria-pressed") === "true") return;
btn.setAttribute("aria-pressed", "true");
btn.setAttribute("aria-label", "Downloaded");
setTimeout(function () {
btn.setAttribute("aria-pressed", "false");
btn.setAttribute("aria-label", "Download");
}, 1800);
});
});
})();How to use Download to Done
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.