Staaarter

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.

By Staaarter Team
Error
Docs
Live preview

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.json

Prefer 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

PropTypeDefaultDescription
eyebrowstring"404"Large error code shown above the heading.
headingstring"Let's get you back on track"Main heading.
descriptionstring"We couldn't find the page you were looking for. Here are a few places to start instead."Short explanation under the heading.
destinationsDestination[]noneCards shown in the destination grid, each with its own icon.
primaryLabelstring"Back to homepage"Label for the primary fallback CTA.
primaryHrefstring"/"Link target for the primary fallback CTA.
secondaryLabelstring"Contact support"Label for the secondary fallback CTA.
secondaryHrefstring"/support"Link target for the secondary fallback CTA.
classNamestringnoneExtra 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).