404 With Popular Articles
A blog 404 that turns a dead post URL into a chance to keep reading: centered messaging sits above a 3-up article grid with cover images, category badges, publish dates, and read times.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, badge, media-slot dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/404-with-popular-articles.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/error/error12.tsx instead.
Usage
The file also exports error12Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Error12, error12Demo } from "@/components/blocks/error/error12"; export default function Page() { return <Error12 {...error12Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| eyebrow | string | "404 error" | Small label above the heading. |
| heading | string | "We couldn't find that story" | Main heading text. |
| description | string | "The article you're looking for may have been moved or unpublished. Here's what other readers are enjoying right now." | Short supporting copy under the heading. |
| homeLabel | string | "Back to blog home" | Label for the fallback button. |
| homeHref | string | "#" | Link target for the fallback button. |
| articlesHeading | string | "Popular articles" | Heading above the article grid. |
| articles | Error12Article[] | none | Articles shown in the 3-up recommendation grid. |
| className | string | none | Extra classes for the outer section element. |
Types
interface Error12Article { id: string; title: string; category: string; date: string; readTime: string; image?: MediaSlotImage; href: string; }
Behavior notes
- Every article card and the fallback button render as real Next.js Link components, but all default to "#" until you supply your own hrefs, nothing is fetched from a real CMS.
- Photos via Unsplash, reused from existing blocks.
More Error Blocks
View all →centered-404-message
Centered 404 Message
Minimal centered 404 with two CTAs and a divided row of popular page links.
404-with-site-search
404 With Site Search
404 screen with a working search box and a bordered list of suggested pages.
split-404-with-image
Split 404 With Image
Two-column 404 with the message on one side and a full-bleed photo that scales on hover on the other.
404-with-destination-cards
404 With Destination Cards
404 screen with a grid of icon destination cards plus fallback CTA buttons.
404-support-panel
404 Support Panel
Card-style 404 echoing the requested URL, with a real back button and a support/status link row.
inline-404-line
Inline 404 Line
The smallest possible 404: code and message on one divided line with one button underneath.