# CommentThread

> A post's comments as an ordered list of pieces a caller arranges: each comment's header of avatar, author and permalinked date, its body, a footer for actions, and its replies nested one level in.

```ts
import { CommentThread } from "@sdxc/ui/blog";
```

Renders the thread: an `<ol>` of CommentThread.Comments, stacked with a gap and no
markers, so the caller numbers comments in their own ids and links. Restyle every part
through CommentThread.CustomProperties on the thread.

## Examples

```tsx
<CommentThread aria-labelledby="comments-heading">
	<CommentThread.Comment id="comment-1">
		<CommentThread.Header>
			<CommentThread.Author href="https://ada.dev">Ada</CommentThread.Author>
			<CommentThread.Permalink href="#comment-1">
				<CommentThread.Date dateTime="2026-11-04T10:05">November 4, 2026</CommentThread.Date>
			</CommentThread.Permalink>
		</CommentThread.Header>
		<CommentThread.Body><p>Lovely post.</p></CommentThread.Body>
	</CommentThread.Comment>
</CommentThread>
```

## Props

Also accepts everything in `TagProps<"ol">`.


### CommentThread.Comment

One comment, its parts stacked in the order written; `byAuthor` sets it on a brand-tinted surface behind a leading rule.

| Prop | Type | Description |
| --- | --- | --- |
| `byAuthor?` | `boolean` | Marks a comment by the post's own author with a tinted surface and a leading rule. |

Also accepts everything in `TagProps<"li">`.


### CommentThread.Header

The comment's header line: whatever it holds (an avatar, the author, the permalinked date) on one wrapping line in small muted type, centred on each other.

Also accepts everything in `TagProps<"header">`.


### CommentThread.Author

The commenter's name in emphasis weight, a link to their site when given an `href`.

Takes no props of its own.

### CommentThread.Permalink

The link to the comment itself, usually wrapping its CommentThread.Date; muted, underlined under the pointer.

Takes no props of its own.

### CommentThread.Date

When the comment was posted, as a `<time>`; the children are the words a reader sees and `dateTime` the moment a machine reads.

Also accepts everything in `TagProps<"time">`.


### CommentThread.Body

What the comment says: its paragraphs spaced apart in the thread's reading face, with no margin outside the first and last.

Also accepts everything in `TagProps<"div">`.


### CommentThread.Footer

The comment's actions, such as a reply link, on one small muted line.

Also accepts everything in `TagProps<"footer">`.


### CommentThread.Replies

The replies to a comment, a nested `<ol>` of CommentThread.Comments indented past a rule down its start.

Also accepts everything in `TagProps<"ol">`.

