terra vidhal

Comment Thread

Component

About

A complete discussion panel with a composer, nested replies, collapsible branches, likes and extra reactions, a highlighted resolved answer and a participant stack. Bodies support bold, italic, inline code, mentions and links. Sort and filter switches are keyboard driven, reply and edit composers open inline with a formatting toolbar, and deletion is undoable. Ships as a card, glass surface or borderless layout with seeded liked, reacted, collapsed, resolved and replying states.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Comment Thread to your project and fits it to your theme.

Code

How Comment Thread is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

/**
 * PrequelUI Animate — MIT — https://prequeluianimate.terravidhal.me
 */

import { CommentThread, type Comment } from "@/components/ui/comment-thread";

const COMMENTS: Comment[] = [
  {
    id: "comment-1",
    author: "Theo Nakamura",
    role: "Design lead",
    badge: "Author",
    createdAt: "2026-11-26T09:12:00",
    likes: 24,
    online: true,
    reactions: [
      { type: "thumbs", count: 6 },
      { type: "party", count: 3 },
    ],
    body: "The onboarding flow is ready for review. **Keyboard pass** and the empty-state copy are the last two items — can we close both before the Friday freeze? @Priya Raman, is the string table final?",
    replies: [
      {
        id: "reply-1",
        author: "Priya Raman",
        role: "Content design",
        createdAt: "2026-11-26T09:41:00",
        likes: 9,
        reactions: [{ type: "thumbs", count: 2 }],
        body: "Copy is frozen. The final strings now live in `onboarding/copy.ts`, so there is one source of truth.",
      },
      {
        id: "reply-2",
        author: "Jonas Weber",
        role: "Frontend",
        createdAt: "2026-11-26T10:22:00",
        likes: 12,
        online: true,
        body: "Keyboard pass is green — both focus traps are patched and the tab order wraps cleanly.",
      },
    ],
  },
  {
    id: "comment-2",
    author: "Amara Okafor",
    role: "Accessibility",
    createdAt: "2026-11-25T16:20:00",
    likes: 14,
    reactions: [{ type: "insight", count: 5 }],
    body: "Contrast now passes **AA in both themes**. The audit is attached to the review, so nothing blocks the release train.",
  },
  {
    id: "comment-3",
    author: "Mara Ellison",
    role: "You",
    createdAt: "2026-11-25T11:04:00",
    likes: 4,
    body: "Moving the release note to *Ready*. I will keep this thread pinned until the Friday freeze.",
  },
];

export default function CommentThreadDemo() {
  return (
    <main className="flex min-h-screen w-full items-center justify-center bg-background px-4 py-10 sm:px-6">
      <CommentThread
        comments={COMMENTS}
        title="Onboarding review"
        currentUser="Mara Ellison"
        variant="plain"
        defaultSort="top"
        defaultFilter="all"
        defaultResolvedId="comment-1"
        defaultLikedIds={["comment-1"]}
        defaultReactedIds={[
          "comment-1:thumbs",
          "reply-1:thumbs",
          "comment-2:insight",
        ]}
        defaultReplyingTo="comment-2"
        defaultReplyDraft="Linking the audit here so it stays with the thread."
      />
    </main>
  );
}

Dependencies

More by terra vidhal

View all
  • Gravity Stars Background

    Gravity Stars Background

    16
  • Audio Waveform

    Audio Waveform

    13
  • Topographic Lines

    Topographic Lines

    12
  • Notification Center

    Notification Center

    11
  • Booking Calendar

    Booking Calendar

    11
  • Spotlight Card

    Spotlight Card

    11
  • Command Palette

    Command Palette

    9
  • Kpi Counter

    Kpi Counter

    9

Explore more

Part of PrequelUI Animate — browse the full library on 21st.dev.