Skip to content

Reply Input Expand

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

Comments & ReactionsHTMLCSSany framework

Copy into your project

HTML
<form class="nuda-reply-expand">
  <textarea class="nuda-reply-expand__field"
            placeholder="Write a reply…" aria-label="Reply" rows="1"></textarea>
  <div class="nuda-reply-expand__actions">
    <button type="button" class="nuda-reply-expand__cancel">Cancel</button>
    <button type="submit" class="nuda-reply-expand__send">Reply</button>
  </div>
</form>
CSS
/* Reply Input Expand
   Textarea + action bar grow into view on focus.
   Customize: --re-bg, --re-border, --re-focus */

.nuda-reply-expand {
  --re-bg: #0c0c10;
  --re-border: #1c1c22;
  --re-focus: #e4ff54;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--re-bg);
  border: 1px solid var(--re-border);
  border-radius: 12px;
  max-width: 420px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.nuda-reply-expand:focus-within {
  border-color: var(--re-focus);
  box-shadow: 0 0 0 3px rgba(228, 255, 84, 0.15);
}

.nuda-reply-expand__field {
  width: 100%;
  background: transparent;
  border: 0;
  color: #fafafa;
  font-size: 13px;
  line-height: 1.5;
  resize: none;
  outline: none;
  min-height: 22px;
  max-height: 200px;
  transition: min-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.nuda-reply-expand__field::placeholder { color: #63636e; }

.nuda-reply-expand:focus-within .nuda-reply-expand__field { min-height: 64px; }

.nuda-reply-expand__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s;
}

.nuda-reply-expand:focus-within .nuda-reply-expand__actions {
  max-height: 40px;
  opacity: 1;
}

.nuda-reply-expand__cancel,
.nuda-reply-expand__send {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 0;
  cursor: pointer;
}

.nuda-reply-expand__cancel { background: transparent; color: #a0a0a8; }
.nuda-reply-expand__cancel:hover { color: #fafafa; }

.nuda-reply-expand__send { background: var(--re-focus); color: #09090b; }
.nuda-reply-expand__send:hover { background: #f0ff7a; }

@media (prefers-reduced-motion: reduce) {
  .nuda-reply-expand,
  .nuda-reply-expand__field,
  .nuda-reply-expand__actions { transition: none; }
}

How to use Reply Input Expand

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