Comment thread preview

Comment thread

One comment with replies – an assistant reports what it did, folds open details and answers @mentions

  • Group
    Chat
  • Origin
    Copied · affectUI · source
  • License
    MIT
  • Added
    Oct 18
npx shadcn@latest add @deank/comment-thread

The registry stays private. Install from the repo with a GitHub token — see the README.

Usage

import { CommentThread } from "@/registry/components/comment-thread/comment-thread";

<CommentThread messages={[/* … */]} currentUser={/* … */} />

Props

NameTypeDefaultDescription
messagesThreadMessage[]id, author, createdAt, text – assistant replies can add a status line with folding details
currentUserThreadAuthorAuthor of new replies
assistantThreadAuthorShown with a thinking state while an answer is on its way
onReply(text) => ThreadMessage | Promise<ThreadMessage | void> | voidReturn a message (or a promise) for the assistant to answer, nothing to just post
onClose() => voidShows a close button
titlestring"Comment"Heading in the gray tray

When to use

- A single conversation attached to a selection, a cell or a line of text - Showing what an assistant did after someone asked for a change

When not to use

Real-time chat (use a chat list).

Related

Message actions · Reaction bar