404 With Destination Cards
A recovery-focused 404 screen: a grid of destination cards (icon, title, description, hover arrow) pointing at popular sections of the site, followed by a centered row of fallback CTA buttons.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/404-with-destination-cards.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/error/error4.tsx instead.
Usage
The file also exports error4Demo, 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 { Error4, error4Demo } from "@/components/blocks/error/error4"; export default function Page() { return <Error4 {...error4Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| eyebrow | string | "404" | Large error code shown above the heading. |
| heading | string | "Let's get you back on track" | Main heading. |
| description | string | "We couldn't find the page you were looking for. Here are a few places to start instead." | Short explanation under the heading. |
| destinations | Destination[] | none | Cards shown in the destination grid, each with its own icon. |
| primaryLabel | string | "Back to homepage" | Label for the primary fallback CTA. |
| primaryHref | string | "/" | Link target for the primary fallback CTA. |
| secondaryLabel | string | "Contact support" | Label for the secondary fallback CTA. |
| secondaryHref | string | "/support" | Link target for the secondary fallback CTA. |
| className | string | none | Extra classes for the outer section element. |
Types
type Destination = { icon: LucideIcon; title: string; description: string; href: string };
Behavior notes
- Every destination card and both fallback CTA buttons are decorative Next.js Links via the button's render prop, pointing wherever each item's href says, nothing is fetched.
- This is a server component, so each destination's icon is passed directly as a LucideIcon component reference in its data object (only client blocks in this repo can't accept an icon as a per-item prop).
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-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.
404-notice-card
404 Notice Card
Compact bordered 404 card with an icon badge, status label, and stacked full-width buttons.