404 page
A friendly 404 section with a link home and optional helpful links.
Preview
The big number tilts toward the mouse pointer. With reduced motion turned on, it renders the plain layout.
Page not found
The page you're looking for moved or never existed.
Page not found
The page you're looking for moved or never existed.
Installation
Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.
Usage
import { NotFound } from "@/components/custom/not-found";
// app/not-found.tsx
export default function NotFoundPage() {
return <NotFound links={[{ label: "Read the docs", href: "/docs" }]} />;
}import { NotFoundMotion } from "@/components/custom/not-found/not-found-motion";
<NotFoundMotion />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| code | string | "404" | The big number (decorative). |
| title | string | "Page not found" | The page's h1. |
| description | string | – | One line on what happened. |
| home | { label; href } | { label: "Back to home", href: "/" } | Main way out. |
| links | { label; href }[] | – | Other helpful pages. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| code | string | "404" | The big number (decorative). |
| title | string | "Page not found" | The page's h1. |
| description | string | – | One line on what happened. |
| home | { label; href } | { label: "Back to home", href: "/" } | Main way out. |
| links | { label; href }[] | – | Other helpful pages. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
Accessibility
- The big number is hidden from screen readers; the h1 says what happened.
- The motion version follows the visitor's reduced-motion setting and never hides content before it animates.