The route draft is ready. Can you check the second day?
Calm motion: animations on this site only fade, with no movement
English
Nested comment thread
Comments with replies, and replies to those replies, as under an issue, a document, or a post. Each comment is a Message. For a chat that runs in one line, use Message and MessageScroller.
<template>
<BlessThread :comments="comments">
<template #footer="{ comment }">
<BlessButton size="sm" variant="ghost" :aria-label="`Reply to ${comment.name}`"
>Reply</BlessButton
>
</template>
</BlessThread>
</template>
<script setup lang="ts">
import { BlessButton, BlessThread, type BlessThreadComment } from "blessing-ui";
const comments: BlessThreadComment[] = [
{
id: 1,
name: "Megumi Kato",
time: "3 h ago",
body: "The route draft is ready. Can you check the second day?",
replies: [
{
id: 2,
name: "Tomoya Aki",
time: "2 h ago",
body: "The museum closes at five. We need to go there first.",
replies: [
{
id: 3,
name: "Megumi Kato",
time: "1 h ago",
body: "Done. I moved lunch to the afternoon.",
},
],
},
{ id: 4, name: "Eriri Spencer", time: "2 h ago", body: "I can draw the map." },
],
},
{
id: 5,
name: "Utaha Kasumigaoka",
time: "Yesterday",
body: "Notes on the ending are in the shared folder.",
collapsed: true,
replies: [{ id: 6, name: "Michiru Hyodo", time: "Yesterday", body: "Read them. Agreed." }],
},
];
</script>comments is a list of { id, name, avatar, time, datetime, body, replies }. replies has the same shape, to any depth.<details>. Its summary counts all the replies below, for example "3 replies". A click or Enter folds them. collapsed: true on a comment starts its replies folded.maxDepth (default 3), the replies stop indenting, so a long chain stays readable on a phone.body is plain text. For links, mentions, or code, use the default slot. The slots default, footer, and actions get { comment, depth } on every level. Put the Reply button in footer.labels.replies or a label pack.import { BlessThread } from "blessing-ui";| Name | Type | Default | Description |
|---|---|---|---|
comments* | BlessThreadComment[] | — | |
maxDepth | number | 3 | replies deeper than this stop indenting, so a long chain stays readable on a phone |
labels | Partial<{ replies: (n: number) => string; }> | — | |
depth | number | 0 |
| Name | Scope | Description |
|---|---|---|
default | { comment: BlessThreadComment; depth: number; } | |
footer | { comment: BlessThreadComment; depth: number; } | |
actions | { comment: BlessThreadComment; depth: number; } |