Give a published story a headline link, byline and reading time. Use featured styling for the lead story and set the heading level to fit the surrounding page. Your app supplies the date label and decides which story leads.
Article preview example
Example.jsx
import { ArticlePreview } from "./ui/article-preview";
import "./example.css";
export default function Example() {
return <div class="sample">
<ArticlePreview featured eyebrow="From the publishing desk" headingLevel={2}
title="When should a one-time QR code stop working?"
href="#preview-fierst-dev-notes-when-should-a-one-time-qr-code-stop-working"
author="Fierst LLC" published={{dateTime:"2026-11-28",label:"November 28, 2026"}}
readingTime="2 min read" summary="You scan a pairing code and dismiss the passkey prompt. Can you tap the button again?" />
</div>;
}
example.css
@media screen and (prefers-reduced-motion: no-preference) {
#example button:is(.v-primary, .v-secondary):enabled {
transition: transform 120ms ease-out;
}
#example button:is(.v-primary, .v-secondary):enabled:active {
transform: scale(0.98);
}
}
@media (prefers-reduced-motion: reduce) {
#example button:is(.v-primary, .v-secondary):enabled:active {
transition: none;
transform: none;
}
}
* {
box-sizing: border-box;
}
:root {
--example-seed: var(--blokd-primary);
--example-secondary-text: var(--blokd-on-surface-subtle);
}
body {
--blokd-primary: color-mix(in srgb, var(--example-seed) 84%, var(--blokd-on-surface));
--blokd-on-surface-subtle: color-mix(in srgb, var(--example-secondary-text) 84%, var(--blokd-on-surface));
--blokd-input-border: color-mix(in srgb, var(--blokd-on-surface) 55%, var(--blokd-surface));
margin: 0;
padding: clamp(0.8rem, 4vw, 1.5rem);
color: var(--blokd-on-surface);
background: var(--blokd-surface-muted);
font: 1rem/1.5 var(--blokd-font-sans);
}
#example {
display: grid;
gap: 0.8rem;
min-width: 0;
align-content: start;
}
#example > button,
.sample > button {
justify-self: start;
}
.sample,
.tile {
background: var(--blokd-surface);
border: 1px solid var(--blokd-border);
border-radius: var(--blokd-radius-lg);
}
.sample {
display: grid;
gap: 0.8rem;
padding: clamp(0.85rem, 3vw, 1.35rem);
box-shadow: var(--blokd-shadow-xs);
min-width: 0;
}
.tile {
padding: 1rem;
min-width: 0;
}
h2,
h3,
p,
dl,
ul {
margin-block: 0;
}
h2,
h3 {
letter-spacing: -0.025em;
line-height: 1.2;
}
h2 {
font-size: 1.25rem;
}
h3 {
font-size: 1rem;
}
.sample > header:not(.split),
.identity > div,
.receipt {
display: grid;
gap: 0.25rem;
}
.sample > header p,
.tile p,
small {
color: var(--blokd-on-surface-muted);
}
small {
font-size: 0.82rem;
}
.split,
.actions,
.identity {
display: flex;
align-items: center;
gap: 0.65rem;
flex-wrap: wrap;
}
.split {
justify-content: space-between;
padding-block: 0.4rem;
border-bottom: 1px solid var(--blokd-border);
}
.split:last-child {
border-bottom: 0;
}
.metric {
font-size: 2rem;
letter-spacing: -0.06em;
}
.facts {
display: grid;
grid-template-columns: max-content 1fr;
gap: 0.45rem 1rem;
}
.facts dt {
color: var(--blokd-on-surface-muted);
}
.facts dd {
margin: 0;
font-weight: 600;
}
.type-sample {
font:
2rem/1.2 Georgia,
serif;
}
.listing {
padding-inline-start: 1.25rem;
}
.ink-strip {
height: 1.2rem;
background: var(--blokd-primary);
border-radius: var(--blokd-radius-sm);
}
.ink-proof {
display: grid;
gap: 0.15rem;
border-left: 0.6rem solid;
padding-left: 0.8rem;
}
.ink-proof strong {
font-size: 1.25rem;
letter-spacing: 0.06em;
}
.glyph {
display: inline-grid;
place-items: center;
width: 2rem;
height: 2rem;
border-radius: var(--blokd-radius-sm);
color: var(--blokd-on-primary-subtle);
background: var(--blokd-primary-subtle);
}
.cover-box {
width: min(100%, 18rem);
}
.cover {
display: flex;
min-height: 7.5rem;
height: 100%;
padding: 1rem 1.25rem;
flex-direction: column;
justify-content: space-between;
gap: 1.6rem;
color: #fff;
background: repeating-linear-gradient(150deg, transparent 0 8px, #fff2 8px 9px), #204a48;
}
.cover strong {
font:
italic 2.45rem/1 Georgia,
serif;
}
.cover span {
font: 0.78rem var(--blokd-font-mono);
}
.cover.grove {
background-color: #3d4b27;
}
.cover.dune {
background-color: #7c4428;
}
button:not([class]),
.entry {
font: inherit;
font-size: 0.875rem;
padding: 0.45rem 0.8rem;
border: 1px solid var(--blokd-border-strong);
border-radius: var(--blokd-radius-control);
background: var(--blokd-surface);
color: var(--blokd-on-surface);
}
button:not([class]) {
cursor: pointer;
font-weight: 600;
}
button:not([class]):hover:enabled {
background: var(--blokd-primary-subtle);
}
button:disabled {
cursor: default;
}
:focus-visible {
outline: 2px solid var(--blokd-primary);
outline-offset: 3px;
}
output:not(:empty) {
display: block;
color: var(--blokd-on-primary-subtle);
font-weight: 600;
font-size: 0.9rem;
}
#example, .sample { grid-template-columns: minmax(0, 1fr); }
.sample > header.split { gap: .75rem; flex-wrap: nowrap; }
.journal-preview { width: min(100%, 26rem); margin-inline: auto; }
.journal-preview header { padding-block: 0 .75rem; }
.journal-preview article { display: grid; gap: .45rem; padding-block: .45rem; }
.journal-preview article p { color: var(--blokd-on-surface-muted); }
Site-owned component source and scoped styles
src/ui/article-preview
import './theme.css';
import { scope } from '@fierst/blokd';
const articleScope = scope`
:scope { min-width:0; padding:1rem 0; border-top:1px solid var(--blokd-border); color:var(--blokd-on-surface); overflow-wrap:anywhere; }
:scope.featured { padding:clamp(1rem,3vw,2rem); border:1px solid var(--blokd-border); border-block-start:3px solid var(--blokd-primary); border-radius:var(--blokd-radius-lg); background:var(--blokd-surface); }
h2,h3 { margin:0; line-height:1.16; font-family:var(--blokd-font-display); font-size:clamp(1.35rem,3vw,2rem); }
a { color:inherit; text-underline-offset:.16em; }
.eyebrow { margin:0 0 .75rem; font:600 .8rem var(--blokd-font-mono); }
.meta { display:flex; gap:.35rem .85rem; flex-wrap:wrap; margin:.95rem 0 0; font-size:.88rem; color:var(--blokd-on-surface-muted); }
.summary { margin:.8rem 0 0; line-height:1.55; }
`;
export function ArticlePreview(props: {
title: string;
href: string;
summary?: string;
eyebrow?: string;
featured?: boolean;
headingLevel?: 2 | 3;
author?: string;
published?: { dateTime: string; label: string };
readingTime?: string;
}) {
const link = <a href={props.href}>{props.title}</a>;
return (
<article class={[articleScope, props.featured ? 'featured' : ''].join(' ')}>
{props.eyebrow && <p class="eyebrow">{props.eyebrow}</p>}
{props.headingLevel === 3 ? <h3>{link}</h3> : <h2>{link}</h2>}
{(props.author || props.published || props.readingTime) && (
<p class="meta">
{props.author && <span>{props.author}</span>}
{props.published && (
<time datetime={props.published.dateTime}>{props.published.label}</time>
)}
{props.readingTime && <span>{props.readingTime}</span>}
</p>
)}
{props.summary && <p class="summary">{props.summary}</p>}
</article>
);
}
Install
sh
npx @fierst/blokd-ui@1.1.0 add article-previewRegistry dependencies: theme.
Exports from ./ui/article-preview: ArticlePreview.
Download the registry source for article-preview 1.1.0.
API contracts
ts
export function ArticlePreview(props: {
title: string;
href: string;
summary?: string;
eyebrow?: string;
featured?: boolean;
headingLevel?: 2 | 3;
author?: string;
published?: { dateTime: string; label: string };
readingTime?: string;
})