Errors
PagesNext.jsTailwind404 not found and 500 server error pages with centered layout and action buttons.
404 — Not Found
404
Page Not Found
The page you're looking for doesn't exist or has been moved.
500 — Server Error
500
Something Went Wrong
An unexpected error occurred. Please try again.
1 // app/not-found.tsx — 404 page 2 // Swap the headline, message copy + button label below for your own wording. 3 import Link from "next/link"; 4 import { Button } from "@/shared/ui/button"; 5 import { Section, Container } from "@/shared/ui/section"; 6 7 export default function NotFound() { 8 return ( 9 <Section className="py-24 md:py-32"> 10 <Container> 11 <div className="mx-auto max-w-md text-center"> 12 <p className="text-primary mb-4 text-7xl font-bold">404</p> 13 <h1 className="mb-2 text-2xl font-bold">Page Not Found</h1> 14 <p className="text-muted-foreground mb-8"> 15 The page you're looking for doesn't exist or has been moved. 16 </p> 17 <Link href="/"> 18 <Button variant="outline">Back to Home</Button> 19 </Link> 20 </div> 21 </Container> 22 </Section> 23 ); 24 } 25 26 // app/error.tsx — 500 page (must be a Client Component) 27 "use client"; 28 29 import { useEffect } from "react"; 30 import { Button } from "@/shared/ui/button"; 31 import { Section, Container } from "@/shared/ui/section"; 32 33 export default function Error({ 34 error, 35 reset, 36 }: { 37 error: Error & { digest?: string }; 38 reset: () => void; 39 }) { 40 useEffect(() => { 41 console.error(error); 42 }, [error]); 43 44 return ( 45 <Section className="py-24 md:py-32"> 46 <Container> 47 <div className="mx-auto max-w-md text-center"> 48 <p className="text-destructive mb-4 text-7xl font-bold">500</p> 49 <h1 className="mb-2 text-2xl font-bold">Something Went Wrong</h1> 50 <p className="text-muted-foreground mb-8"> 51 An unexpected error occurred. Please try again. 52 </p> 53 <Button variant="outline" onClick={() => reset()}> 54 Try Again 55 </Button> 56 </div> 57 </Container> 58 </Section> 59 ); 60 }