CommentView
Data Display

CommentView

Display a comment with its author, timestamp, replies, and actions.

CommentView displays one comment and its nested replies. Pass onReply and onReact to handle reader interactions.

Import

TSX
import { CommentView } from "@solarius/onset";

Props

CommentViewProps props
PropTypeDefaultDescription
commentComment—The comment to render.
depthnumber0Nesting depth for indentation.
maxDepthnumber3Maximum nesting for the Reply button.
onReply(parentId: string, body: string) => void—Reply handler.
onReact(commentId: string, emoji: string) => void—Reaction handler.
renderActions(comment: Comment) => ReactNode—Header action controls.

Example

CommentView