Staaarter

Inline 404 Line

The smallest possible 404 screen: a status code and message on a single line separated by a vertical rule (stacking vertically on mobile), with a single outline button underneath.

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/inline-404-line.json

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

Usage

The file also exports error6Demo, 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 { Error6, error6Demo } from "@/components/blocks/error/error6";

export default function Page() {
  return <Error6 {...error6Demo} />;
}

Props

PropTypeDefaultDescription
codestring"404"Status code shown on the left of the divider.
messagestring"This page could not be found."Message shown on the right of the divider.
buttonLabelstring"Back to homepage"Label for the button underneath.
buttonHrefstring"/"Link target for the button underneath.
classNamestringnoneExtra classes for the outer section element.

Behavior notes

  • The button is a decorative Next.js Link via the button's render prop, pointing wherever buttonHref says, nothing is fetched.
  • The vertical rule between code and message is a plain border, hidden below the sm breakpoint where the two lines stack vertically instead.