
Usage
import { CommentThread } from "@/registry/components/comment-thread/comment-thread";
<CommentThread messages={[/* … */]} currentUser={/* … */} />Props
| Name | Type | Default | Description |
|---|---|---|---|
| messages | ThreadMessage[] | id, author, createdAt, text – assistant replies can add a status line with folding details | |
| currentUser | ThreadAuthor | Author of new replies | |
| assistant | ThreadAuthor | Shown with a thinking state while an answer is on its way | |
| onReply | (text) => ThreadMessage | Promise<ThreadMessage | void> | void | Return a message (or a promise) for the assistant to answer, nothing to just post | |
| onClose | () => void | Shows a close button | |
| title | string | "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).