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';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
value | CommentNode[] | Controlled value; use with onValueChange. | |
defaultValue | CommentNode[] | [] | Initial value when uncontrolled. |
onValueChange | (comments: CommentNode[]) => void | Called with the new value when it changes. | |
currentUser | CommentAuthor | { name: 'You' } | Author of new comments and owner of the composer avatar. |
onReply | (reply: CommentNode, parentId: string | null) => void | Called after a comment is added; parentId is null for top-level comments. | |
onLike | (commentId: string, liked: boolean) => void | Called after a comment's like is toggled, with its new state; the thread already updated the count. | |
maxDepth | number | 3 | Nesting levels that get their own indentation; deeper replies line up with their parent (default 3). |
locale | string | Locale for counts and dates (default: the ThemeProvider's, then the browser's). | |
labels | Partial<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 · Весь раздел «Контент и соцсети»