# Comment thread

A thread of comments with a box to add one; ⌘ or Ctrl Enter posts. PlankUI component for React 19 and Tailwind CSS v4. Category: Blocks.

## Install

```bash
npx plankui@latest add comment-thread
```

## Usage

```tsx
import { CommentThread } from "@/components/ui/comment-thread";

<CommentThread comments={comments} me={{ name: "Jun Li" }} onPost={addComment} />
```

## Props

| 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. |

Source: https://github.com/VectorLabsHQ/plankui/blob/main/components/ui/comment-thread.tsx
