Error 404
Search the site instead, or jump straight to one of the pages people land on most.
Search-first 404 page: a controlled search field with a submit handler, plus a bordered list of suggested pages with titles, descriptions, and hover arrows.
A 404 page that treats search as the primary recovery path: a controlled input with a submit handler sits directly under the heading, followed by a bordered list of suggested destinations with titles, descriptions, and hover arrows.
Free block
This block is free. No license or account is required: install it with the CLI and use it in unlimited projects.
Radix flavor
npx shadcn add "https://ui.beste.co/r/error2"Base UI flavor
npx shadcn add "https://ui.beste.co/r-base/error2"This installs the block to components/beste/block/error2.tsx, plus the button and input shadcn/ui primitives it uses for the search form.
The installed file exports error2Demo alongside the block: the exact props behind the preview above. Spread it to get a working 404 screen in one line.
import { Error2, error2Demo } from "@/components/beste/block/error2";
export default function NotFound() {
return <Error2 {...error2Demo} />;
}Wire onSearch to your own search route and pass your own destinations:
"use client";
import { useRouter } from "next/navigation";
import { Error2 } from "@/components/beste/block/error2";
export default function NotFound() {
const router = useRouter();
return (
<Error2
code="Error 404"
heading="We could not find that page"
description="Search the site instead, or jump to one of these pages."
labels={{
placeholder: "Search documentation",
submit: "Search",
suggestions: "Suggested pages",
}}
suggestions={[
{ title: "Getting started", description: "Install and ship", href: "/docs" },
{ title: "Support", description: "Get help from a human", href: "/support" },
]}
onSearch={(query) => router.push(`/search?q=${encodeURIComponent(query)}`)}
/>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
code | string | – | Small uppercase status label above the heading |
heading | string | – | Main page heading, rendered as an h1 |
description | string | – | Explanatory paragraph under the heading |
labels | Error2Labels | {} | Search placeholder, submit button text, and suggestion list caption |
suggestions | SuggestionLink[] | [] | Rows in the bordered suggestion list |
onSearch | (query: string) => void | – | Called on form submit with the trimmed query |
className | string | – | Extra classes for the outer <section> |
type Error2Labels = {
placeholder?: string;
submit?: string;
suggestions?: string;
};
type SuggestionLink = {
title: string;
description?: string;
href: string;
};event.preventDefault() and passes the trimmed query to onSearch, so nothing navigates by default: routing is entirely up to the caller.onSearch handler the form still submits harmlessly (the optional call is skipped), which keeps the block safe to drop in before search exists.type="search", so browsers render their native clear affordance, and the placeholder doubles as the field's aria-label.labels.submit is set, leaving an input-only search bar for compact layouts.sm breakpoint; suggestion rows are separated by divide-y inside one bordered container and highlight on hover through the named group/error2 group.error30
Monochrome 404 that hands the visitor a search field: a display headline with a muted emphasis clause, a rounded search bar with a circular submit seal wired to a callback, and a ruled list of the most travelled routes.
error36
A not-found page that offers a way forward rather than a way back, pairing an oversized light heading with an image tile floating a live search panel and a two-column hairline list of likely destinations.
error38
A not-found page for a publication, offering a search field as the first action and the month's most read pieces underneath, with a line committing to link permanence.
error13
404 page that doubles as a sitemap: left-aligned messaging over four columns of grouped section links, so visitors on a large site can jump straight to the area they wanted.