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.
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.jsonPrefer 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
| Prop | Type | Default | Description |
|---|---|---|---|
| code | string | "404" | Status code shown on the left of the divider. |
| message | string | "This page could not be found." | Message shown on the right of the divider. |
| buttonLabel | string | "Back to homepage" | Label for the button underneath. |
| buttonHref | string | "/" | Link target for the button underneath. |
| className | string | none | Extra 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.
More Error Blocks
View all →centered-404-message
Centered 404 Message
Minimal centered 404 with two CTAs and a divided row of popular page links.
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.
404-notice-card
404 Notice Card
Compact bordered 404 card with an icon badge, status label, and stacked full-width buttons.