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

Article Card

News card: vertical, horizontal and over a photo. Pro · Content and social › Feed and news

Installation

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

Props

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.

Related components

  • Live Blog — Live blog: update feed, pinned and key events
  • Breaking News — “Breaking” banner with rotating headlines
  • Article Comments — Article comments: votes, sorting, replies, moderation
  • Article Header — Article header: section, headline, lede, authors and date
  • Byline — Byline: authors, published and updated dates, reading time
  • Article Figure — Image with caption and photo credit
  • Pull Quote — Pull quote with attribution
  • Key Points — “Key points” summary block
  • Editor Note — Update, correction, disclosure and sponsored-content notes
  • Article Toc — Article table of contents that tracks the current section
  • Reading Progress — Reading progress bar
  • Share Bar — Share: Telegram, VK, X, WhatsApp, email and copy link

Previous: Author Bio · Next: Live Blog · All Content and social