ValyroUI English version

Article Card

Карточка новости: вертикальная, горизонтальная и поверх фото. Pro · Контент и соцсети › Лента и новости

Установка

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

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

Пропсы

PropTypeDefault
title *ReactNodeHeadline of the story.
hrefstringStory URL; the whole card becomes clickable through the headline link.
excerptReactNodeTeaser text under the headline.
kickerReactNodeRubric above the headline: "Analysis", "Opinion".
badgeReactNodeLabel over the image corner: "Video", "Exclusive", "Live".
imageReactNodeThe image element itself (next/image, <picture>), in place of imageSrc; it fills the card's media box.
imageSrcstringLead image; without it a quiet placeholder keeps a grid of cards even, and a horizontal card drops its image column.
imageAltstring''Text alternative of the image (default "": the headline already names the story).
imageSrcSetstringResponsive sources for the image ("card-400.jpg 400w, card-800.jpg 800w"): a feed of cards then downloads thumbnails, not originals.
imageSizesstring'(min-width: 48rem) 33vw, 100vw'Display widths for imageSrcSet (default "(min-width: 48rem) 33vw, 100vw").
prioritybooleanfalseA card above the fold (the lead story): its image loads at once with high priority instead of lazily.
authorsArticleAuthor[][]Writers shown in the meta line (names only).
publishedDateInputPublication date.
readingMinutesnumberEstimated reading time in minutes.
commentCountnumberNumber of reader comments.
layout'vertical' | 'horizontal' | 'overlay''vertical'vertical: image on top (default); horizontal: image beside the text; overlay: text over the image.
headingLevel1 | 2 | 3 | 4 | 5 | 63Level of the headline (default 3).
timeZonestringIANA time zone of the dates shown, e.g. "Europe/Moscow" (default: the ThemeProvider's, then the reader's). Set it, here or on the provider, when rendering on the server, so the server and the browser print the same time.
localestringBCP 47 locale for numbers and dates; defaults to the ThemeProvider's, then the browser's.
labelsPartial<ArticleCardLabels>Overrides for the built-in English text; keys left out keep their defaults.

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

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

Назад: Author Bio · Далее: Live Blog · Весь раздел «Контент и соцсети»