ValyroUI Русская версия

Comment Thread

Nested comment thread. Pro · Content and social › Social

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add comment-thread
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { CommentThread } from 'valyro-ui-pro';

Props

PropTypeDefault
valueCommentNode[]Controlled value; use with onValueChange.
defaultValueCommentNode[][]Initial value when uncontrolled.
onValueChange(comments: CommentNode[]) => voidCalled with the new value when it changes.
currentUserCommentAuthor{ name: 'You' }Author of new comments and owner of the composer avatar.
onReply(reply: CommentNode, parentId: string | null) => voidCalled after a comment is added; parentId is null for top-level comments.
onLike(commentId: string, liked: boolean) => voidCalled after a comment's like is toggled, with its new state; the thread already updated the count.
maxDepthnumber3Nesting levels that get their own indentation; deeper replies line up with their parent (default 3).
localestringLocale for counts and dates (default: the ThemeProvider's, then the browser's).
labelsPartial<CommentThreadLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Post Card · Next: Profile Card · All Content and social