Components › Blocks
Comment thread
A thread of comments with a box to add one; ⌘ or Ctrl Enter posts.
Installation
npx plankui@latest add comment-threadUsage
import { CommentThread } from "@/components/ui/comment-thread";
<CommentThread comments={comments} me={{ name: "Jun Li" }} onPost={addComment} />API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| comments | { id, author, avatar?, dateTime, time, body }[] | required | The thread, oldest first. |
| me | { name, avatar? } | required | Who is writing. |
| onPost | (text: string) => void | Promise<void> | Called with the new comment; the box clears when it resolves. |