Maja Lindqvist2 hours ago
The guest asked for a late check-in around 22:00. Can someone cover the desk?
Nils Berg1 hour ago
I can stay until 23:00 on Friday.
Maja Lindqvist40 minutes ago
Thank you, I will tell the guest.
Install
npx shadcn add @klarhimmel/app-comments-threadUsage
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import AppCommentsThread from '@/components/klarhimmel/blocks/app-comments-thread';
export default function Section() {
return (
<Theme theme="brand">
<BlockSurface>
<AppCommentsThread props={{
"eyebrow": "Discussion",
"title": "Notes on this booking",
"description": "Only your team sees these.",
"summaryWord": "comments",
"comments": [
{
"author": "Maja Lindqvist",
"time": "2 hours ago",
"body": "The guest asked for a late check-in around 22:00. Can someone cover the desk?",
"replies": [
{
"author": "Nils Berg",
"time": "1 hour ago",
"body": "I can stay until 23:00 on Friday."
},
{
"author": "Maja Lindqvist",
"time": "40 minutes ago",
"body": "Thank you, I will tell the guest."
}
]
}
],
"replyLabel": "Reply",
"replyForm": {
"label": "Your reply",
"submit": "Send reply",
"cancel": "Cancel"
},
"composer": {
"label": "Add a comment",
"submit": "Post comment",
"posting": "Posting…",
"empty": "Write something first."
},
"you": "You",
"justNow": "just now",
"notices": {
"posted": "Comment posted.",
"replied": "Reply posted."
},
"state": "filled",
"messages": {
"emptyTitle": "No comments yet",
"emptyBody": "Start the discussion. Your team is notified.",
"error": "We could not post your comment. Try again."
}
}} />
</BlockSurface>
</Theme>
);
}comment thread in 4 forms: filled, empty, posting, error.
Discussion
Only your team sees these.
3 comments
Maja Lindqvist2 hours ago
The guest asked for a late check-in around 22:00. Can someone cover the desk?
Nils Berg1 hour ago
I can stay until 23:00 on Friday.
Maja Lindqvist40 minutes ago
Thank you, I will tell the guest.
Start the discussion. Your team is notified.
Discussion
Only your team sees these.
3 comments
Maja Lindqvist2 hours ago
The guest asked for a late check-in around 22:00. Can someone cover the desk?
Nils Berg1 hour ago
I can stay until 23:00 on Friday.
Maja Lindqvist40 minutes ago
Thank you, I will tell the guest.
Start the discussion. Your team is notified.
Discussion
Only your team sees these.
3 comments
Maja Lindqvist2 hours ago
The guest asked for a late check-in around 22:00. Can someone cover the desk?
Nils Berg1 hour ago
I can stay until 23:00 on Friday.
Maja Lindqvist40 minutes ago
Thank you, I will tell the guest.
Start the discussion. Your team is notified.
Discussion
Only your team sees these.
3 comments
Maja Lindqvist2 hours ago
The guest asked for a late check-in around 22:00. Can someone cover the desk?
Nils Berg1 hour ago
I can stay until 23:00 on Friday.
Maja Lindqvist40 minutes ago
Thank you, I will tell the guest.
Start the discussion. Your team is notified.
A discussion under a record: comments with replies one level deep and a field to write a new one. For a conversation with an assistant use `app-assistant-thread`; for a notification feed use `app-notifications-inbox`.
- Use 1 to 4 top-level comments with up to 3 replies each. Give every comment an author and time so the replies make sense without extra context. - `replyLabel` (20) is followed by the author's name for screen readers, so use just Reply rather than Reply to this comment. - `composer.empty` (80) is shown when someone posts an empty field. Say what to write, not that the field is invalid.
What a person posts lives only in this block and is not saved, and it starts over when the thread props change. Replies cannot be nested further, so a reply form on a reply is not offered.
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import AppCommentsThread from '@/components/klarhimmel/blocks/app-comments-thread';
export default function Section() {
return (
<Theme theme="brand">
<BlockSurface>
<AppCommentsThread props={{
"eyebrow": "Discussion",
"title": "Notes on this booking",
"description": "Only your team sees these.",
"summaryWord": "comments",
"comments": [
{
"author": "Maja Lindqvist",
"time": "2 hours ago",
"body": "The guest asked for a late check-in around 22:00. Can someone cover the desk?",
"replies": [
{
"author": "Nils Berg",
"time": "1 hour ago",
"body": "I can stay until 23:00 on Friday."
}
]
}
],
"replyLabel": "Reply",
"replyForm": {
"label": "Your reply",
"submit": "Send reply",
"cancel": "Cancel"
},
"composer": {
"label": "Add a comment",
"submit": "Post comment",
"posting": "Posting…",
"empty": "Write something first."
},
"you": "You",
"justNow": "just now",
"notices": {
"posted": "Comment posted.",
"replied": "Reply posted."
},
"state": "filled",
"messages": {
"emptyTitle": "No comments yet",
"emptyBody": "Start the discussion. Your team is notified.",
"error": "We could not post your comment. Try again."
}
}} />
</BlockSurface>
</Theme>
);
}The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
eyebrow | string | 'Discussion' | Text, up to 60 characters. Optional; empty is not rendered. |
title | string | 'Notes on this booking' | Text, up to 120 characters. |
description | string | 'Only your team sees these.' | Text, up to 300 characters. Optional; empty is not rendered. |
summaryWord | string | 'comments' | Text, up to 20 characters. |
comments | { author, time, body, replies }[] | 1 item | List of 1 to 4. Each item: author, time, body, replies. |
replyLabel | string | 'Reply' | Text, up to 20 characters. |
replyForm | { label, submit, cancel } | {…} | Fields: label, submit, cancel. |
composer | { label, submit, posting, empty } | {…} | Fields: label, submit, posting, empty. |
you | string | 'You' | Text, up to 24 characters. |
justNow | string | 'just now' | Text, up to 24 characters. |
notices | { posted, replied } | {…} | Fields: posted, replied. |
state | 'filled' | 'empty' | 'posting' | 'error' | 'filled' | One of 'filled', 'empty', 'posting', 'error'. |
messages | { emptyTitle, emptyBody, error } | {…} | Fields: emptyTitle, emptyBody, error. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |
Installs
app-comments-thread