React 404 Page
NotFound is a React 404 page block: a large code whose zeros are glass rings, a plain explanation, a slot for your own search field, a main action and suggested links. It is also usable for 403 and 500 pages.
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/not-found-page.jsonError 404
This page has drifted off
The address may be mistyped, or the page may have moved. Search for what you need, or pick up from one of these.
NotFounddefaultNotFoundLabels
With search and links
The search slot takes any node: an Input, a Combobox or a command palette trigger. The block does not search for you. Remember to answer with HTTP status 404 from your router.
Error 404
This page has drifted off
The address may be mistyped, or the page may have moved. Search for what you need, or pick up from one of these.
import { NotFound } from "@/components/sheenui/blocks/not-found-page";
import { Input } from "@/components/sheenui/input/input";
// Package build (after the first npm release, or a packed tarball): import { Input, NotFound } from "@sheenui/theme";
// This example also uses input: npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/input.json
export function Example() {
return (
<NotFound
headingLevel={1}
action={{ label: "Back to home", href: "/" }}
search={<Input type="search" aria-label="Search the site" placeholder="Search the docs" />}
links={[
{ label: "Documentation", href: "/docs", description: "Guides and API reference" },
{ label: "Pricing", href: "/pricing", description: "Plans for every team" },
{ label: "Contact", href: "/contact", description: "Talk to a person" },
]}
/>
);
}Files to copy
7 folders · 11 files · 4 packages
- From
theme/src/ blocks/not-found-page.tsxcomponents/button/components/spinner/hooks/{use-latest.ts, use-magnetic.ts, use-media-query.ts, use-preferences.ts}motion/{gate.ts, tokens.ts}lib/{cn.ts, form.ts, heading.ts, state-light.tsx}styles/
- shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/not-found-page.jsonRegistry item: not-found-page. The styles need the Tailwind v4 glass UI setup.- The examples also use
components/input/lib/field-size.ts
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/input.json- Packages
pnpm add @base-ui/react clsx motion tailwind-merge
A custom status code and your own wording
code takes any short string (each 0 becomes a ring), and labels replaces every sentence, so the same block serves a 403 or a 500.
Error 403
You need permission for this page
Sign in with an account that has access, or ask the owner to invite you.
import { NotFound } from "@/components/sheenui/blocks/not-found-page";
// Package build (after the first npm release, or a packed tarball): import { NotFound } from "@sheenui/theme";
export function Example() {
return (
<NotFound
code="403"
action={{ label: "Sign in", onClick: () => console.log("sign in") }}
labels={{
codeLabel: "Error 403",
title: "You need permission for this page",
description: "Sign in with an account that has access, or ask the owner to invite you.",
}}
/>
);
}Props
NotFoundLabels keys and English defaults (4)
Keyboard
Accessibility
- A <section> named by its heading. A 404 page's heading is its h1: pass headingLevel={1}.
- The large code is aria-hidden; labels.codeLabel ('Error 404') is read instead.
- Suggested links are a labelled list of real anchors with 44 px targets. The zeros are glass surfaces (keep to two or three), and nothing loops.
- Digits settle on a spring and the rings drop in once. Reduced motion removes the movement.
All exports on this page
NotFound— A 404 page: a large code whose zeros are glass rings, a plain heading and explanation, a slot for your search field, a way back.defaultNotFoundLabels— The English NotFoundLabels used when labels is omitted; a partial labels prop is merged over it.
When to use the 404 page
- Use NotFound as the not-found route of an app or a marketing site, with a main action back home, three or four suggested links and your search field in the search slot.
- Use the search slot for an Input, a Combobox or a command-palette trigger; the block does not search by itself, so it never promises a result it cannot give.
- Use code="403" or "500" with labels for the title and description to reuse the block for other error pages without a second component.
- Skip it as an inline empty state inside a list; EmptyState is the right component for 'no results', while NotFound is a whole page.
- Pair it with AnnouncementBanner and SiteFooter, and have your router answer with HTTP status 404, because the block only draws the page.
Frequently asked questions
Related pages
20 blocks pages in all: browse them on All blocks.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .