Article Card
interlace-ui/article-cardFreeComponent
Two article tiles that share one focusable-anchor shell: `ArticleCard`, the stacked grid tile with the cover on top, and `FeaturedArticleCard`, the full-bleed hero whose copy sits on a gradient scrim over the image. Both read the same props.
Install it
npx shadcn@latest add https://ds.interlace.tools/r/article-card.jsonSource
1'use client';23import * as React from 'react';45// @interlace/article-card v1.5.0 — Interlace design system.6// Docs, props and live preview: https://ds.interlace.tools/c/article-card7// What changed since: https://ds.interlace.tools/c/article-card#history8// Generated banner — keep it, the upgrade diff reads this version.910/**11 * @interlace/ui — ArticleCard + FeaturedArticleCard12 *13 * Two article tiles that share one focusable-anchor shell: `ArticleCard`, the14 * stacked grid tile with the cover on top, and `FeaturedArticleCard`, the15 * full-bleed hero whose copy sits on a gradient scrim over the image. Both16 * read the same props.17 *18 * They are two components rather than one `variant` prop because the rendered19 * tree differs entirely (R11). The old `variant` still type-checks for one20 * minor: `variant="overlay"` delegates to `FeaturedArticleCard` and a21 * dev-only `console.warn` fires from `useDeprecatedVariantWarning`.22 *23 * ## Anatomy24 *25 * CardShell (a[href] — data-slot="article-card")26 * └─ Card (primitives/card, py-0 gap-0)27 * ├─ StackBody (ArticleCard)28 * │ ├─ cover aspect-[1000/420] + SourceChip29 * │ ├─ CardHeader (avatar + author name + date)30 * │ ├─ CardContent (title, description, tag Badges)31 * │ └─ CardFooter (MetaChips + ExternalLink on hover)32 * └─ OverlayBody (FeaturedArticleCard)33 * ├─ absolute cover + scrim gradient34 * ├─ FeaturedChip / SourceChip35 * └─ tags, h2 title, description, author · date · MetaChips36 *37 * ## Dates are pinned to UTC38 *39 * `formatDate` passes `timeZone: 'UTC'`, matching `patterns/author-byline.tsx`.40 * A date-only ISO string (`"2026-05-10"`) parses as UTC midnight, so without41 * the pin `toLocaleDateString` re-projects it into the reader's zone and42 * everyone west of UTC is shown the previous day — on a grid of cards, next to43 * a post whose byline said otherwise.44 *45 * ## The cover box matches the cover's own aspect ratio46 *47 * The stacked tile reserves `aspect-[1000/420]`, the exact ratio of the48 * `width={1000} height={420}` the card already declares on the image. It used49 * to reserve `h-44` — a fixed 176px HEIGHT, which fixes nothing about the50 * ratio, because the ratio then floats with the card's width. At the 320px51// … truncated
More from interlace-ui
All 140 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| A11y Startera11y-starter | interlace-ui | Components | Free | no deps | |
| Accordionaccordion | interlace-ui | Components | Free | no deps | |
| Alertalert | interlace-ui | Components | Free | no deps | |
| Alert Dialogalert-dialog | interlace-ui | Components | Free | no deps | |
| Animated Gradient Textanimated-gradient-text | interlace-ui | Components | Free | no deps | |
| Animated Grid Patternanimated-grid-pattern | interlace-ui | Components | Free | no deps | |
| Animated Listanimated-list | interlace-ui | Components | Free | no deps | |
| Article List Gridarticle-list-grid | interlace-ui | Components | Free | no deps |
