A single comment โ author, time, rich body, reactions and reply โ as a project feed draws it.
npx shadcn@latest add https://sdk-components.thesqd.com/r/comment-card.jsonimport { CommentCard } from "@/components/blocks/comment-card";"use client";
import { CommentCard } from "@/components/blocks/comment-card";
export function Example() {
return (
<CommentCard
author={{ name: "Marisol Vega" }}
body="Looks great โ adding a couple pins."
timestamp={new Date()}
onReact={(emoji, added) => console.log(emoji, added)}
onReply={() => console.log("reply")}
/>
);
}CommentCard (single component โ pass everything as props)
โโโ avatar (author.avatar ?? Avatar(author.name, author.avatarUrl);
โ inside the card, left of the name, by default โ avatarPosition)
โโโ card-surface (brand tint when `mine`)
โโโ header
โ โโโ name ยท summary ยท (edited) (name + avatar: author.card / onClick / href
โ โ โ hover card, click, link; underline on hover)
โ โโโ โฏ menu (hover-revealed, `actions`)
โโโ body (string โ rich markdown; any node as-is)
โโโ footer
โโโ reaction chips + EmojiPicker popover + Reply + replies toggle (left)
โโโ time (right; hover โ full date)Marisol Vega
Here's Round 2. We leaned into the 70s marquee reference and softened the gradient behind the title.
TheSquad
Comments just got rich โจ
Everything you can write in a comment now renders: lists, code, highlights and more.
Jacob Vendramin(edited)
Test
Marisol Vega left a note on Sermon Bumper
Pushed the coral pop on the title โ let me know where to tighten.
TheSquad
Comments just got rich โจ
Everything you can write in a comment now renders: lists, code, highlights and more.
Jacob Vendramin(edited)
Test
CommentCard
| Prop | Type | Default | Description |
|---|---|---|---|
author | CommentAuthor | โ | Who left the comment โ name, photo, or your own avatar node. |
body | ReactNode | โ | A string renders as rich markdown; any other node as-is. |
summary | ReactNode | โ | Muted words after the name, e.g. "left a note on Sermon Bumper". |
heading | ReactNode | โ | Replaces the name line (name, summary, (edited)) outright โ for a card that announces something. |
timestamp | Date | string | number | โ | "12:58 PM" today, "Sep 18 ยท 12:58 PM" otherwise; full date on hover. |
time | ReactNode | โ | Replaces the formatted time outright. |
edited | boolean | false | Adds "(edited)" after the name. |
mine | boolean | false | Tints the card in the brand colour. |
avatarPosition | "outside" | "inside" | "none" | "inside" | Where the avatar sits: in the card beside the name, beside the card (a column down a rail), or not at all. |
reactions | CommentReaction[] | [] | Chips in the footer. The card toggles them optimistically; a new array re-syncs. |
reactionChoices | string[] | ["๐","โค๏ธ","๐","๐","๐","๐"] | The reaction picker's Popular row, shown until the viewer has recent picks. |
emojiPicker | Pick<EmojiPickerProps, โฆ> | โ | Passed to the reaction picker (the SDK EmojiPicker): saved `recent` / `skinTone` with their handlers, a phrase `suggester`, a self-hosted `emojibaseUrl`. |
onReact | (emoji: string, added: boolean) => void | โ | Enables the picker and tappable chips. |
onReply | () => void | โ | Shows the Reply button. |
replyLabel | string | "Reply" | Reply button label. |
actions | DropdownMenuItemSpec[] | โ | Items for the hover-revealed โฏ menu (same shape as DropdownMenu `items`). |
actionsLabel | string | "Show more actions" | Tooltip + aria-label of the โฏ button. |
className | string | โ | Classes on the outer row. |
cardClassName | string | โ | Classes on the card itself โ a highlight ring, an accent edge. |
CommentAuthor
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | โ | Display name; drives initials + avatar colour. |
avatarUrl | string | null | โ | Photo URL. Falls back to initials. |
avatar | ReactNode | โ | Your own avatar node (Inky, a presence ring, โฆ). Wins over avatarUrl. |
card | ReactNode | โ | Opened on hover or focus of the name or the avatar โ a person card, say. |
onClick | () => void | โ | Fires on a click of the name or the avatar. |
href | string | โ | Makes the name and the avatar a link. Any of card / onClick / href underlines the name on hover. |
CommentReaction
| Prop | Type | Default | Description |
|---|---|---|---|
emoji | string | โ | The glyph. |
count | number | โ | How many picked it. |
mine | boolean | โ | The viewer is one of them โ the chip reads pressed. |
who | string[] | โ | Names for the hover label ("Josh, Ashley and 2 more"). |
Marisol Vega
Here's Round 2. We leaned into the 70s marquee reference and softened the gradient behind the title.