Like Button
A copy-paste comments & reactions component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Comments & ReactionsHTMLCSSany framework
Copy into your project
HTML
<button type="button" class="nuda-like-btn" aria-pressed="false" aria-label="Like">
<span class="nuda-like-btn__ripple" aria-hidden="true"></span>
<svg class="nuda-like-btn__icon" viewBox="0 0 24 24" aria-hidden="true">
<path d="M12 21s-7-4.5-9.5-9C1 9 2.5 5 6.5 5c2 0 3.5 1 5.5 3 2-2 3.5-3 5.5-3 4 0 5.5 4 4 7-2.5 4.5-9.5 9-9.5 9z"
fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" />
</svg>
<span class="nuda-like-btn__label">Like</span>
</button>CSS
/* Like Button
Heart fills + ripple glow when toggled on.
Toggle aria-pressed="true" in JS to lock the liked state. */
.nuda-like-btn {
position: relative;
display: inline-flex;
align-items: center;
gap: 6px;
padding: 7px 14px 7px 12px;
background: #0c0c10;
border: 1px solid #1c1c22;
border-radius: 999px;
color: #a0a0a8;
font-size: 12px;
font-weight: 500;
cursor: pointer;
overflow: hidden;
transition: color 0.25s, border-color 0.25s;
}
.nuda-like-btn__icon {
width: 16px;
height: 16px;
color: #a0a0a8;
transition: color 0.25s, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.nuda-like-btn__ripple {
position: absolute;
inset: 0;
background: radial-gradient(circle at center, rgba(255, 94, 122, 0.25), transparent 65%);
opacity: 0;
transition: opacity 0.4s;
}
.nuda-like-btn:hover { color: #fafafa; border-color: #ff5e7a; }
.nuda-like-btn:hover .nuda-like-btn__icon { color: #ff5e7a; transform: scale(1.18); }
.nuda-like-btn:hover .nuda-like-btn__ripple { opacity: 1; }
.nuda-like-btn[aria-pressed="true"] .nuda-like-btn__icon {
color: #ff5e7a;
fill: #ff5e7a;
animation: nuda-lb-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.nuda-like-btn:focus-visible {
outline: 2px solid #e4ff54;
outline-offset: 2px;
}
@keyframes nuda-lb-pop {
0% { transform: scale(0.7); }
50% { transform: scale(1.35); }
100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
.nuda-like-btn,
.nuda-like-btn__icon,
.nuda-like-btn__ripple { transition: none; }
.nuda-like-btn[aria-pressed="true"] .nuda-like-btn__icon { animation: none; }
}How to use Like Button
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.