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.
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.jsonPrefer 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
| Prop | Type | Default | Description |
|---|---|---|---|
| eyebrow | string | "404" | Large error code shown above the heading. |
| heading | string | "Page not found" | Main heading. |
| description | string | "The page you're looking for doesn't exist or has been moved." | Short explanation under the heading. |
| primaryLabel | string | "Back to homepage" | Label for the primary CTA button. |
| primaryHref | string | "/" | Link target for the primary CTA. |
| secondaryLabel | string | "Contact support" | Label for the secondary CTA button. |
| secondaryHref | string | "/support" | Link target for the secondary CTA. |
| popularLinks | PopularLink[] | none | Popular destinations shown in the divided link row underneath the CTAs. |
| className | string | none | Extra 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.
More Error Blocks
View all →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.
404-notice-card
404 Notice Card
Compact bordered 404 card with an icon badge, status label, and stacked full-width buttons.