Eidetic

Comment Card

Social
Block

Display user comments with avatars, timestamps, likes, and nested replies.

Preview

Single comment with interactions

EW
Emily WatsonProduct Manager3 hours ago

This is exactly what we needed for the dashboard redesign. The component API is intuitive and the styling options are flexible enough for our use cases.

5 replies

Simple Comment

Basic comment without interactions

JD
John DoeYesterday

Looking forward to the next release!

Nested Replies

Comment with nested reply thread

AT
Alice ThompsonEngineer5 hours ago

Has anyone tested this with the new API endpoints?

BM
Bob Martinez4 hours ago

Yes! Works perfectly with v2 endpoints.

CD
Carol DavisQA3 hours ago

Confirmed on staging environment as well.

Comment Thread

Full thread with multiple comments

LB
Lisa BergmannAdmin2 hours ago

Great progress on the new features! The design system is coming together nicely.

2 replies
AR
Alex Rivera1 hour ago

Thanks Sarah! The team has been working hard on this.

JK
Jordan KimDesign Lead45 mins ago

Excited to see it in production soon!

LA
Lars Andersen4 hours ago

Quick question - will the new components be backwards compatible with the existing theme?

CommentCard Props

CommentCard API reference

PropTypeDefaultDescription
author*CommentAuthorComment author info
content*stringComment text content
timestamp*stringWhen comment was posted
likesnumber0Number of likes
repliesnumber0Number of replies
likedbooleanfalseWhether current user liked
onLike() => voidLike button callback
onReply() => voidReply button callback
onMore() => voidMore options callback
childrenReactNodeNested reply comments
classNamestringAdditional CSS classes

CommentThread Props

CommentThread API reference

PropTypeDefaultDescription
comments*CommentWithReplies[]Array of comments with nested replies
classNamestringAdditional CSS classes

Types

Supporting type definitions

interface CommentAuthor {
name: string
avatar?: string
role?: string // e.g., "Admin", "Moderator"
}
interface CommentCardProps {
author: CommentAuthor
content: string
timestamp: string
likes?: number
replies?: number
liked?: boolean
onLike?: () => void
onReply?: () => void
onMore?: () => void
children?: React.ReactNode
className?: string
}
// For CommentThread
interface CommentWithReplies extends CommentCardProps {
id: string
replies?: Array<CommentCardProps & { id: string }>
}

Usage

Import and implementation examples

import { CommentCard, CommentThread } from '@/blocks/data-display/comment-card'
// Single comment
<CommentCard
author={{ name: 'Jane Doe', role: 'Admin' }}
content="Great work on this feature!"
timestamp="2 hours ago"
likes={5}
liked={isLiked}
onLike={() => setIsLiked(!isLiked)}
onReply={() => openReplyModal()}
/>
// With nested replies
<CommentCard
author={{ name: 'John Smith' }}
content="Question about the implementation..."
timestamp="1 day ago"
>
<CommentCard
author={{ name: 'Jane Doe' }}
content="Here's the answer..."
timestamp="20 hours ago"
/>
</CommentCard>
// Full thread
<CommentThread
comments={[
{
id: '1',
author: { name: 'User 1' },
content: 'First comment',
timestamp: '3h ago',
replies: [
{ id: '1-1', author: { name: 'User 2' }, content: 'Reply', timestamp: '2h ago' }
]
}
]}
/>

Built With

2 components

This block uses the following UI components from the design system:

Features

Built-in functionality

  • User avatars: Display author profile pictures with fallback initials
  • Author roles: Show badges for admins, moderators, etc.
  • Like functionality: Interactive like button with count
  • Reply support: Reply button and nested comment threads
  • Nested comments: Indented replies with visual hierarchy
  • More options: Contextual menu for edit, delete, report
  • Dark mode: Full dark mode support

Accessibility

Accessibility considerations

ARIA Attributes

Avatar images have alt text with author nameInteractive elements have proper focus statesLike count updates are announced to screen readers

Keyboard Navigation

KeyAction
TabNavigate between interactive elements
Enter/SpaceActivate like, reply, and more buttons

Notes

  • Timestamps could be enhanced with datetime attribute
  • Consider aria-live for dynamic like counts
  • Nested comments maintain proper heading hierarchy