ValyroUI English version

Post Card

Карточка публикации. Pro · Контент и соцсети › Соцсети

Установка

npx valyro-cli@latest login
npx valyro-cli@latest add post-card
npm install valyro-ui-pro

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

Пропсы

PropTypeDefault
author *PostAuthorByline: avatar, name, verified badge and @handle.
time *DateInputPosting time (Date, ISO string or epoch ms), shown as a live relative age like "5m".
text *stringPlain-text body, clamped to maxLines with a "Show more" button.
mediaMediaItem[]Attached images, laid out as a MediaGallery mosaic with a fullscreen viewer.
linkPostLinkPreviewLink preview card under the text; opens in a new tab when it has href.
commentCountnumber0Shown next to the comment button in compact form; hidden at 0.
repostCountnumber0Server count; it already includes the viewer's repost when reposted started true.
likeCountnumber0Server count; it already includes the viewer's like when liked started true.
likedbooleanControlled liked; use with onLikedChange.
defaultLikedbooleanfalseInitial liked when uncontrolled.
onLikedChange(liked: boolean) => voidCalled with the new liked when it changes.
repostedbooleanControlled reposted; use with onRepostedChange.
defaultRepostedbooleanfalseInitial reposted when uncontrolled.
onRepostedChange(reposted: boolean) => voidCalled with the new reposted when it changes.
bookmarkedbooleanControlled bookmarked; use with onBookmarkedChange.
defaultBookmarkedbooleanfalseInitial bookmarked when uncontrolled.
onBookmarkedChange(bookmarked: boolean) => voidCalled with the new bookmarked when it changes.
onComment() => voidCalled by the comment button.
onShare() => voidCalled by the share button.
menuItemsPostMenuItem[][]Entries of the "more" menu; the button is hidden when empty.
maxLinesnumber4Lines of text shown before "Show more" (default 4).
localestringLocale for counts and dates (default: the ThemeProvider's, then the browser's).
labelsPartial<PostCardLabels>Overrides for the built-in English text; keys left out keep their defaults.

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

  • Comment Thread — Дерево комментариев
  • 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, почта и копирование ссылки

Назад: Interactive Quote Deck · Далее: Comment Thread · Весь раздел «Контент и соцсети»