Skip to content

404 Page 1

404 page with a gradient numeral, primary actions and helpful links.

01 / 01

Installation

Run this in a project that already uses shadcn/ui. The CLI adds the block, its components and npm dependencies.

pnpm dlx shadcn@latest add https://ui.sumansharma.info.np/r/error-page-1.json
Prefer to iterate with AI?Open in

Usage

The CLI writes the block to components/error-page-1.tsx. Import it anywhere:

Loading...

Source

The CLI writes this component to components/error-page-1.tsx.

import Link from 'next/link'
import { ArrowLeft, BookOpen, LifeBuoy, Newspaper } from 'lucide-react'
import { Button } from '@/components/ui/button'

const suggestions = [
    { icon: BookOpen, title: 'Documentation', body: 'Guides and API reference.', href: '#' },
    { icon: Newspaper, title: 'Blog', body: 'Product news and stories.', href: '#' },
    { icon: LifeBuoy, title: 'Support', body: 'Talk to a real person.', href: '#' },
]

export default function NotFound() {
    return (
        <section className="relative isolate flex min-h-screen items-center overflow-hidden py-16">
            <div
                aria-hidden
                className="absolute inset-0 -z-10 bg-[linear-gradient(to_right,var(--color-border)_1px,transparent_1px),linear-gradient(to_bottom,var(--color-border)_1px,transparent_1px)] bg-[size:48px_48px] [mask-image:radial-gradient(ellipse_50%_50%_at_50%_40%,#000,transparent)]"
            />
            <div className="mx-auto w-full max-w-2xl px-6 text-center">
                <p className="from-foreground to-foreground/20 bg-gradient-to-b bg-clip-text text-[clamp(6rem,22vw,11rem)] font-bold leading-none tracking-tighter text-transparent">404</p>
                <h1 className="mt-4 text-balance text-3xl font-semibold sm:text-4xl">This page wandered off</h1>
                <p className="text-muted-foreground mx-auto mt-4 max-w-md text-pretty">The link may be broken or the page may have moved. Let’s get you back on track.</p>

                <div className="mt-8 flex flex-wrap justify-center gap-3">
                    <Button
                        asChild
                        size="lg">
                        <Link href="/">
                            <ArrowLeft className="size-4" />
                            Back to home
                        </Link>
                    </Button>
                    <Button
                        asChild
                        size="lg"
                        variant="outline">
                        <Link href="#">Contact support</Link>
                    </Button>
                </div>

                <ul className="mt-14 grid gap-3 text-left sm:grid-cols-3">
                    {suggestions.map(({ icon: Icon, title, body, href }) => (
                        <li key={title}>
                            <Link
                                href={href}
                                className="bg-background/80 hover:bg-muted/60 flex h-full flex-col rounded-xl border p-4 backdrop-blur transition-colors">
                                <Icon className="text-muted-foreground size-4" />
                                <span className="mt-3 text-sm font-medium">{title}</span>
                                <span className="text-muted-foreground text-xs">{body}</span>
                            </Link>
                        </li>
                    ))}
                </ul>
            </div>
        </section>
    )
}