Article Card

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.

blog & long-formclientuiv1.5.0

Preview

Article Card — live renderblocks-articlecard--default

Rendered from the story the storybook (a11y) CI gate runs axe against — the preview can't show something that hasn't been verified.

Install

Two equivalent paths — the URL works in any shadcn-CLI setup; the alias works once you've registered @interlace in your components.json.

Via shadcn URL
npx shadcn@latest add https://ds.interlace.tools/r/article-card.json
With the @interlace alias
npx shadcn@latest add @interlace/article-card

Behavior

What this component does — the keyboard path, the measured colour, the text equivalent and the states it can be in. Every figure below is read out of the test or the source that enforces it by scripts/build-behavior-map.mjs, so nothing here can outlive the gate that keeps it true.

Every semantic colour pair this component's own source uses, measured against the shipped hexes in all 4 theme × scheme combinations. The tightest is muted-foreground on background at 7.82:1 (harbor · light), against a floor of 4.5:1.

Measured WCAG contrast ratios per token pair and theme
PairinterlacelightinterlacedarkharborlightharbordarkFloor
muted-foreground on backgroundsecondary copy9.41:111.32:17.82:19.52:14.5:1SC 1.4.3
muted-foreground on cardsecondary copy in a card9.41:110.48:18.25:18.64:14.5:1SC 1.4.3
ring on backgroundfocus ring (SC 2.4.13)8.80:111.79:18.39:110.03:13.0:1SC 1.4.11
primary on backgroundprimary tint on the page surface8.80:111.79:18.39:110.03:13.0:1SC 1.4.11
ring on cardfocus ring inside a card8.80:110.92:18.86:19.10:13.0:1SC 1.4.11
primary on cardprimary tint inside a card8.80:110.92:18.86:19.10:13.0:1SC 1.4.11
foreground on backgroundbody copy19.65:116.97:117.74:116.19:14.5:1SC 1.4.3
scrim-foreground on scrimcopy over an image scrim21.00:121.00:121.00:121.00:14.5:1SC 1.4.3

Text pairs are held to 4.5:1 (WCAG 2.2 SC 1.4.3); borders, rings and chart axes to 3:1 (SC 1.4.11 non-text). Bold is the worst cell in the row — the one a brand fork has to keep an eye on.

Where it renders, how narrow it survives, and whether its lines are inside the coverage gate — three answers a consumer needs before the paste, not after the bug.

Render boundary
'use client'

Hydrates. It brings JavaScript to any route that imports it — put the boundary here, not at the page.

Minimum viewport
none declared

No width floor: it takes the width it is given. Its container owns the layout question.

Coverage gate
not in the gate

The 100% gate currently covers src/charts/**/*.{ts,tsx} and src/lib/**/*.{ts,tsx} and src/primitives/{button-variants,data-state-model,meter-scale,skeleton-variants}.ts and src/primitives/{alert,aspect-ratio,avatar,badge,box,breadcrumb,button,callout,card,checkbox,container,data-state,focus-ring,grade-badge,grid,input,label,meter,pagination,published-date,reading-time,section,section-boundary,separator,skip-link,stack,stat-strip,tag,textarea,typography,visually-hidden}.tsx. This file is outside it — the glob widens in phase 7.2.

History

This component is at v1.5.0, first shipped in @interlace/ui 1.0.0. The version is stamped as a banner into the file the install writes, so the copy in your tree says which one you have — compare it with the number above before deciding whether to re-run the install.

@interlace/ui 1.1.02 entries

  • Changedpatch

    Six defects found by upgrading a real consumer, plus five found by reading the components closely enough to document them. **Meteors' glow never painted.** It read var(--color-meteor-glow) while its cssVars declare --meteor-glow; --color-* is the Tailwind @theme namespace and only cssVars.theme populates it, so the whole box-shadow was invalid at computed-value time. **This was broken only for registry consumers** — our own docs site hand-declares the --color- form. **ArticleCard cropped 28% off every cover.** h-44 is 176px; at a ~302px tile that is a 1.72:1 box against a 2.381:1 image. Now aspect-[1000/420] — the ratio the card already declared on its <img>. It also gains a renderImage slot, because every Next.js consumer was re-patching the same line to use next/image and the design system cannot depend on it. **BorderBeam and StarsBackground had no aria-hidden at all** — six purely decorative nodes a screen reader walked. **CloudParticles defaulted bodyColor to currentColor**, painting volumetric clouds in the inherited text colour. **NumberTicker gains notation**, because six-figure metrics overflow a tile at 320px. Also: SheetCompose and DialogCompose each mounted a second backdrop, so a composed dialog dimmed the page twice as much as the hand-composed tree the docs show; Accordion dropped className on the animated Panel; Tooltip accepted delay and discarded it; PopoverAnchor was a second trigger. **useReducedMotion was one frame late.** The canonical useState(false) plus effect returns false on the first render, so every gated component painted one frame of exactly the motion the user turned off. useSyncExternalStore reads during render and closes that on client renders; on hydration the server cannot know the preference, which is what the stylesheet reset is for. Badge drops 'use client' — verified with a real server-component build.

  • Changedpatch

    The fourteen blocks/* re-export aliases now name the release they disappear in. They previously said "removal scheduled for one release cycle after the architecture PR lands", which is not a date anyone can plan around — so the aliases were, in practice, permanent. They are now @deprecated since 1.0.0 — removed in 2.0.0, and removal will land as a breaking change with a migration note.

    Migration

    Nothing changes today — @interlace/ui/blocks/<name> still resolves. Before 2.0.0, change those imports to @interlace/ui/patterns/<name>; the exported names are identical.

Import

4 named exports — pull the parts you need.

Public API
import { ArticleCard, ArticleCardVariant, FeaturedArticleCard, FeaturedArticleCardProps } from '@/components/ui/patterns/article-card';

Anatomy

Extracted from the primitive's JSDoc header. The source is the only documentation that can't drift.

CardShell                        (a[href] — data-slot="article-card")
    └─ Card                        (primitives/card, py-0 gap-0)
        ├─ StackBody               (ArticleCard)
        │   ├─ cover aspect-[1000/420] + SourceChip
        │   ├─ CardHeader          (avatar + author name + date)
        │   ├─ CardContent         (title, description, tag Badges)
        │   └─ CardFooter          (MetaChips + ExternalLink on hover)
        └─ OverlayBody             (FeaturedArticleCard)
            ├─ absolute cover + scrim gradient
            ├─ FeaturedChip / SourceChip
            └─ tags, h2 title, description, author · date · MetaChips

API reference

Parsed from the type declarations in the source — the same file the install writes into your tree, so this table can't drift from the component you get.

ArticleCardImageProps

PropTypeDescription
src*string
alt*stringAlways `''`. The cover is decorative; the card title is the accessible name.
width*numberIntrinsic cover dimensions — also the ratio the cover box reserves.
height*number
loading*'eager' | 'lazy'
fetchPriority*'high' | 'auto'
decoding*'async'
className*stringCarries `object-cover`, the object-position, and the `motion-safe:group-hover:scale-105` hover gate. Forward it to keep the card's motion and reduced-motion contract; drop it and you own both.

ArticleCardBaseProps

PropTypeDescription
titlestringCard title (article headline). Optional when `loading={true}`.
descriptionstringOptional short description / excerpt.
hrefstringDestination URL. The whole card becomes a link to it. Optional when `loading={true}`.
imageUrlstringCover image URL. If omitted, a gradient with the title is shown.
tagsstring[]Tags / topics — first 3 rendered as filled badges, the rest as a "+N" overflow chip.
authorArticleCardAuthorAuthor block.
publishedAtstring | number | DatePublication date (any value `Date` constructor accepts). Rendered short-form: `Mar 5, 2026`.
metaArticleCardMetaReactions / comments / reading-time chips on the footer.
sourceLabelstringSmall uppercase label shown over the cover (e.g., source attribution like "Dev.to").
externalbooleanOpen in a new tab. @default true
prioritybooleanHint the cover image is the LCP element on this route. Eager-loads it with `fetchpriority="high"`. Set on the single featured card above the fold; leave default on every grid tile. @default false
renderImage(props: ArticleCardImageProps) => React.ReactNodeRender the cover with something other than a plain `<img>` — typically `next/image`, which the DS cannot depend on and stay framework-agnostic. Receives the full {@link ArticleCardImageProps} bag the card would otherwise have spread onto the element. Defaults to exactly that spread, so omitting it is identical to the behaviour before the slot existed. A `next/image` adapter is a one-line function that forwards the bag; keep `className`, which carries the fit and the reduced-motion gate. The live example is Storybook's `Blocks/ArticleCard → renderImage` story. It is deliberately NOT a fenced code block in this comment: the registry build inlines these headers into `r/*.json`, and a JSDoc usage example has already made 131 of 132 items silently uninstallable once. Not called at all when `imageUrl` is absent — the gradient-and-title fallback is the card's own chrome, not an image.
classNamestringClass on the outer anchor wrapper.
loadingbooleanWhen true, render a `<Skeleton variant="article-card" />` composite (image + title lines + meta row silhouette) instead of the card. Shape-matched so card grids don't shift on data arrival. @default false

ArticleCardProps

PropTypeDescription
variantArticleCardVariant@deprecated Pass no `variant` for the stacked tile; render `<FeaturedArticleCard>` instead of `variant="overlay"`. A kind-prop that switches the whole rendered tree hides two components inside one type (R11). Still honoured for one minor, with a dev-mode warning.

BodyProps

PropTypeDescription
title*string
visibleTags*string[]
overflowTags*number
testId*stringRoot test id — every part derives its own id from this.

Skeleton

Pass loading and the component renders a shape-matched <Skeleton /> in its own place — same box, so nothing reflows when the data lands. Below is the same story with loading={true}.

Article Card — loading stateblocks-articlecard--loading
Usage
<ArticleCard loading={isPending} />

Accessibility

Every story for this component is rendered headlessly and checked with axe-core (wcag2aa, wcag22aa, best-practice, ACT) on every PR. That gate has no continue-on-error, so what ships has zero known violations.

What follows is what static analysis can see. Axe cannot press a key and never sees an overlay open, so the operable-without-a-mouse claim lives in Behavior instead, where the keyboard path is replayed step by step.

Focus + keyboard behaviour
Native element semantics — no interaction layer to get wrong.
Focus ring (WCAG 2.2 SC 2.4.13)
Inherited from the preflight focus contract shipped in @interlace/theme.
Reduced motion
Animation is gated on prefers-reduced-motion.
ARIA in the source
None — semantics come from the element or the Base UI primitive rather than hand-written ARIA.

Examples

16 more states from the same story file.

R-rule compliance

Every primitive in @interlace/ui models to the portable 26-rule floor enforced by the componentApi ESLint preset. The cells below pin exactly where each rule applies in this file.

RuleConceptWhere
R5testid required, no default`'data-testid': string` → `{value}-title` / `-tags` / …
R6data-slot on every part`article-card` / `-source` / `-scrim` / `-meta-views`
R10Composition seam`CardShell` wraps both bodies; `Card*` primitives inside
R11No kind-proptwo exports, `variant` deprecated
R19Tokens only`bg-scrim/70`, `text-scrim-foreground`, `text-primary`
R23CLS=0stack cover reserves `aspect-[1000/420]`; hero pins `h-105 md:h-95`
R25Client component`React.useEffect` in the deprecation warning
R26A11ycover `alt=""`; overlay title is `<h2>` for heading order
R5testid required, no default`'data-testid': string` → `{value}-title` etc.
R6data-slot on every part`article-card` / `-title` / `-tags` / `-meta`
R11No kind-prop`variant` deprecated; layouts are separate components
R19Tokens onlyscrim + semantic status tokens, no palette escapes
R23CLS=0cover reserves `h-44`; `loading` paints a shape-match
R25Deprecation`variant` warns in dev before it is removed

Dependencies

Base UI primitive
Native / no Base UI dependency
Lucide icons
  • Clock
  • ExternalLink
  • Eye
  • Heart
  • MessageCircle
  • Sparkles
NPM dependencies
  • lucide-react

Source

The full implementation — components/ui/patterns/article-card.tsx once installed.

949 lines · TypeScript
'use client';

import * as React from 'react';

// @interlace/article-card v1.5.0 — Interlace design system.
// Docs, props and live preview: https://ds.interlace.tools/c/article-card
// What changed since: https://ds.interlace.tools/c/article-card#history
// Generated banner — keep it, the upgrade diff reads this version.

/**
 * @interlace/ui — ArticleCard + FeaturedArticleCard
 *
 * 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.
 *
 * They are two components rather than one `variant` prop because the rendered
 * tree differs entirely (R11). The old `variant` still type-checks for one
 * minor: `variant="overlay"` delegates to `FeaturedArticleCard` and a

…929 more lines…

Registry JSON

The raw registry record — what the shadcn CLI fetches.