Skip to content

Reply Nested

A copy-paste comments & reactions component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Comments & ReactionsHTMLCSSany framework
MC
Mira Chen

Has anyone tried this with Svelte?

AK
Alex K.

Works perfectly — it's plain CSS.

Copy into your project

HTML
<div class="nuda-reply-nested">
  <article class="nuda-reply-nested__parent">
    <div class="nuda-reply-nested__avatar">MC</div>
    <div class="nuda-reply-nested__body">
      <span class="nuda-reply-nested__name">Mira Chen</span>
      <p class="nuda-reply-nested__text">Has anyone tried this with Svelte?</p>
    </div>
  </article>
  <div class="nuda-reply-nested__children">
    <article class="nuda-reply-nested__child">
      <div class="nuda-reply-nested__avatar">AK</div>
      <div class="nuda-reply-nested__body">
        <span class="nuda-reply-nested__name">Alex K.</span>
        <p class="nuda-reply-nested__text">Works perfectly — it's plain CSS.</p>
      </div>
    </article>
  </div>
</div>
CSS
.nuda-reply-nested {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 440px;
}

.nuda-reply-nested__parent,.nuda-reply-nested__child {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: #0c0c10;
  border: 1px solid #1c1c22;
  border-radius: 10px;
}

.nuda-reply-nested__children {
  position: relative;
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nuda-reply-nested__children::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg,#e4ff54,transparent);
  transform-origin: top;
  animation: _rngrow .6s cubic-bezier(.16,1,.3,1) both;
}

.nuda-reply-nested__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fafafa;
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.nuda-reply-nested__body {
  flex: 1;
  min-width: 0;
}

.nuda-reply-nested__name {
  color: #fafafa;
  font-size: 12px;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.nuda-reply-nested__text {
  color: #a0a0a8;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}

.nuda-reply-nested__child {
  animation: _rnslide .5s cubic-bezier(.16,1,.3,1) both;
}

@keyframes _rngrow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes _rnslide {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-reply-nested__children::before,.nuda-reply-nested__child {
    animation: none;
    transform: none;
    opacity: 1;
  }
}

How to use Reply Nested

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.

More comments & reactions components

← Browse all NudaUI components