Staaarter

Centered 404 Message

A minimal, centered 404 screen: a large error code, a heading, a short explanation, two call-to-action buttons, and a divided row of popular page links underneath for visitors who want to keep browsing.

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/centered-404-message.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/error/error1.tsx instead.

Usage

The file also exports error1Demo, 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 { Error1, error1Demo } from "@/components/blocks/error/error1";

export default function Page() {
  return <Error1 {...error1Demo} />;
}

Props

PropTypeDefaultDescription
eyebrowstring"404"Large error code shown above the heading.
headingstring"Page not found"Main heading.
descriptionstring"The page you're looking for doesn't exist or has been moved."Short explanation under the heading.
primaryLabelstring"Back to homepage"Label for the primary CTA button.
primaryHrefstring"/"Link target for the primary CTA.
secondaryLabelstring"Contact support"Label for the secondary CTA button.
secondaryHrefstring"/support"Link target for the secondary CTA.
popularLinksPopularLink[]nonePopular destinations shown in the divided link row underneath the CTAs.
classNamestringnoneExtra classes for the outer section element.

Types

type PopularLink = { label: string; href: string };

Behavior notes

  • Every button and link in this block, the two CTAs and every popular-page link, is decorative: they render as real Next.js Links via the button's render prop but point wherever `href` says, nothing is fetched or validated.