Staaarter

Split 404 With Image

A two-column 404 screen: error code, heading, explanation, two CTAs, and a small note on one side, paired with a full-bleed photo that gently scales on hover on the other. The image side can be flipped with imageSide.

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, media-slot dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/split-404-with-image.json

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

Usage

The file also exports error3Demo, 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 { Error3, error3Demo } from "@/components/blocks/error/error3";

export default function Page() {
  return <Error3 {...error3Demo} />;
}

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.
notestring"If you typed the address, double check the spelling and try again."Small helper text under the CTAs.
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.
imageMediaSlotImagenonePhoto shown in the image panel. Falls back to a placeholder when omitted.
imageSide"left" | "right""right"Which side the image panel renders on at the lg breakpoint.
classNamestringnoneExtra classes for the outer section element.

Behavior notes

  • The image scale-on-hover is a real CSS transition (transition-transform + hover:scale-105 on the image itself, clipped by an overflow-hidden wrapper), not JavaScript.
  • Both CTA buttons are decorative Next.js Links via the button's render prop, pointing wherever primaryHref/secondaryHref say.
  • The image panel is hidden below the lg breakpoint so the message stays full-width and readable on mobile.