Not Found Page

Animated 404 page with subtle icon motion and reduced-motion support.

Component

404

Oops! Page not found

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Back to Home

Installation

pnpm dlx shadcn@latest add "https://pulkitxm.com/components/not-found-page.json"

Usage

Import

Add the NotFoundPage import.

import { NotFoundPage } from "@/components/not-found-page";

Use

Use in app/not-found.tsx.

export default function NotFound() {
  return <NotFoundPage />;
}

Guidelines

  • Use in app/not-found.tsx (Next.js App Router) for the 404 route.
  • Requires next/link; ensure you are in a Next.js project.
  • Respects useReducedMotion; icon wobble is disabled when reduced motion is preferred.

Props

PropTypeDefaultDescription
classNamestringAdditional CSS classes.
homeHrefstring"/"URL for the back/home link.
titlestring"404"Main heading text.
descriptionstring"Oops! Page not found"Subheading text.
backLabelstring"Back to Home"Label for the back link.
iconReact.ReactNode<Frown />Custom icon rendered above the title. Accepts any React element — lucide icon, SVG, or emoji.

Examples

Basic

Use in app/not-found.tsx for Next.js App Router.

404

Oops! Page not found

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Back to Home
import { NotFoundPage } from "@/components/not-found-page";

export default function NotFound() {
  return <NotFoundPage />;
}

Custom text

Customize text and home link.

404

Oops! Page not found

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Back to Home
import { NotFoundPage } from "@/components/not-found-page";

export default function NotFound() {
  return (
    <NotFoundPage
      homeHref="/"
      title="404"
      description="Page not found"
      backLabel="Go home"
    />
  );
}

Custom icon

Pass any React element as the icon — a lucide icon, custom SVG, or emoji.

404

Oops! Page not found

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Back to Home
import { Ghost } from "lucide-react";
import { NotFoundPage } from "@/components/not-found-page";

export default function NotFound() {
  return (
    <NotFoundPage
      icon={
        <Ghost className="mx-auto h-24 w-24 text-muted-foreground" />
      }
    />
  );
}

Made with ❤️ by Pulkit & Cursor :)

© 2026 Pulkit. All rights reserved

DMCA Verified

Last updated: