ValyroUI English version

Comment Thread

Дерево комментариев. Pro · Контент и соцсети › Соцсети

Установка

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';

Пропсы

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.

Похожие компоненты

  • Post Card — Карточка публикации
  • Profile Card — Профиль пользователя
  • Reaction Bar — Лайки и реакции
  • Article Header — Шапка статьи: рубрика, заголовок, лид, авторы и дата
  • Byline — Подпись: авторы, дата публикации и обновления, время чтения
  • Article Figure — Иллюстрация с подписью и автором фото
  • Pull Quote — Выносная цитата с атрибуцией
  • Key Points — Блок «Главное» с ключевыми тезисами
  • Editor Note — Обновление, исправление, раскрытие и пометка о спонсорстве
  • Article Toc — Оглавление статьи с подсветкой текущего раздела
  • Reading Progress — Полоса прогресса чтения
  • Share Bar — Поделиться: Telegram, VK, X, WhatsApp, почта и копирование ссылки

Назад: Post Card · Далее: Profile Card · Весь раздел «Контент и соцсети»