Error Pages React block for Tailwind CSS v4
v1.1.0Updated in 1.9.0
React error pages in one block: 404 not found, 500 server error, maintenance, offline and no permission, full page or inside an app shell.
The illustration rises in and the 404 compass needle swings and settles once; everything else fades up in order when the page mounts on the client (reduced motion keeps only short fades). 404: "Back to the home page" and "Go back" (history back, or home without history); the search focuses with / and Enter searches (a live region says what is being searched); the four suggestion cards are links that lift on hover and press in on tap. 500: "Try again" spins while it checks; a failed try shows a red alert with the time, the error id copies with one click ("Copied"), and "Technical details" opens the time, the path and the stack trace (the code block scrolls sideways on phones and has its own copy button). Maintenance: a live countdown to the end with the return date under it, the status page and support links, a 30 day uptime bar (hover, tap or arrow keys read each day) and "Notify me", an email field that validates when you leave it and ends in a confirmation; when the countdown reaches zero the page says "Maintenance is over" and the primary action becomes "Reload". Offline: an automatic retry every retryInterval seconds with a thin progress bar and "Trying again in 8 s", "Try now" at any time; the browser's online event retries at once, draws the cloud's slash away, says "You are back online" and then reloads (or calls onReconnect); pages saved on the device stay one tap away. Forbidden: "Request access" opens a dialog (a bottom sheet on phones) with an admin picker and a reason of at least 10 characters; submitting empty shows both errors, a valid request closes it, the button turns into a disabled "Request sent · 4:42 PM" and a green confirmation takes focus; "Switch account" signs out, and the signed-in account is shown. State changes are announced politely, never every second; the title takes focus when the page is reached by navigation.
Error Pages is a Pro React block in the React blocks category, written in TypeScript for React 19 and Tailwind CSS v4. It installs as source with npx wingo-ui@latest add error-pages, together with Marketing Section, Alert, Avatar, Badge, Button and 20 more and the npm packages motion, lucide-react, react-hook-form and zod.
Built with
The sections this page is made of. In the full-screen preview, hold Alt to outline each one on the page.
Add to a project
Requirements: React 19 and Tailwind CSS v4, in Next.js (App Router or Pages), Vite or React Router. Installation guide · Next.js setup · Vite setup
npx wingo-ui@latest add error-pagesError Pages is part of Pro, with 298 more Pro items: $8 a month or $150 once. 14-day refund before you download any Pro item. See plans
Usage
Import ErrorPage from @/components/blocks/error-pages.
// app/not-found.tsx
"use client";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { ErrorPage } from "@/components/blocks/error-pages";
export default function NotFound() {
const router = useRouter();
return (
<ErrorPage
variant="404"
linkComponent={Link}
onBack={() => router.back()}
onSearch={(query) => router.push(`/search?q=${encodeURIComponent(query)}`)}
/>
);
}
// app/error.tsx: <ErrorPage variant="500" error={error} errorId={error.digest} onRetry={reset} />
// inside the admin layout: <ErrorPage variant="forbidden" layout="inline" resource="Financial reports" />Props
variantdefault"404""404" | "500" | "maintenance" | "offline" | "forbidden"Which error screen to show.
layoutdefault"page""page" | "inline"page: min-h-dvh with the logo on top and a small footer; inline: fills a shell's main (min-h-[70dvh]) without logo or footer.
backgrounddefault"grid""plain" | "soft" | "glow" | "aurora" | "grid" | "dots"The page layout's background: plain is the bare page color with a dotted field behind the illustration; the others tint the page and add a glow, an aurora, a grid or dots over the first screen. The inline layout keeps the shell's background.
backgroundColordefault"oklch(0.62 0.14 275)"stringThe tint and glow color of the page background.
titledefault""ReactNodeReplaces the variant's title.
descriptiondefault""ReactNodeReplaces the variant's description.
illustrationReactNode | falseThe art above the eyebrow; default ErrorIllustration for the variant, false hides it.
homeHrefdefault"/"stringThe logo and "Back to the home page".
onBack() => void404 "Go back". Default: history.back() when there is history, otherwise the home link.
supportHrefdefault"mailto:support@acme.com"string"Contact support" on every variant.
statusHrefdefault"https://status.acme.com"stringThe status page in the header, the footer and the maintenance actions; "" hides those links.
showSearchdefaulttrueboolean404: the search field (role search).
onSearch(query: string) => void404: runs on Enter. Default: navigates to /search?q=.
searchShortcutdefault"/"stringFocuses the 404 search from anywhere; "" binds nothing.
suggestionsErrorPageSuggestion[]404 link cards { label, href, icon?, description? }; default ERROR_PAGE_SUGGESTIONS (Dashboard, Clients, Invoices, Help); [] hides them.
errorIddefault"ERR-7F3K-2026"string500: the id to quote to support, copyable under the actions and in the details; "" hides it.
errorError | { message: string; stack?: string }500: the details, a sample TypeError by default. Without a stack the details show the message only.
errorPathdefault"/invoices/2026-0412"string500: the page that failed, in the details.
occurredAtdefault"2026-09-24T16:40:12"Date | number | string500: when it failed, in the details.
showDetailsdefaulttrueboolean500: the "Technical details" collapsible.
defaultDetailsOpendefaultfalseboolean500: the details start open.
onRetry() => (void | Promise<unknown>)500 retry, offline check and the maintenance reload. A rejection shows the failure (500 alert, offline keeps waiting). Default: 500 fails the first try and reloads on the next, offline passes once the browser fired online, maintenance reloads.
untildefault"2026-09-27T04:00:00"Date | number | stringMaintenance: the end. In the past the page already says "Maintenance is over".
statusHistoryTrackerDatum[]Maintenance: the uptime bar, default ERROR_PAGES_SAMPLE.statusHistory (30 days, one partial day on Sep 18, 2026).
uptimedefault0.9995numberMaintenance: the uptime share shown next to the bar (99.95%).
showStatusdefaulttruebooleanMaintenance: the uptime history.
showSubscribedefaulttruebooleanMaintenance: the "Notify me" email form.
defaultEmaildefault""stringMaintenance: prefills the email.
onSubscribe(email: string) => (void | Promise<unknown>)Maintenance: saves the email; a rejection shows its message under the field. Default: simulated.
retryIntervaldefault10numberOffline: seconds between automatic retries (0 = off); each failed try starts a new wait.
onReconnect() => voidOffline: runs 1.6 s after the connection came back (and on "Continue"). Default: reloads the page.
offlinePagesErrorPageOfflinePage[]Offline: pages saved on the device { label, href, savedAt, icon? }; default ERROR_PAGE_OFFLINE_PAGES; [] hides the list.
admins{ id: string; name: string; avatar?: string; role?: string }[]Forbidden: who can grant access (Emma Carter, Ryan Brooks). [] shows only the support link.
resourcedefault"Financial reports"ReactNodeForbidden: what was refused.
onRequestAccess(input: ErrorPageAccessRequest) => (void | Promise<unknown>)Forbidden: sends { adminId, reason }; a rejection shows its message in the dialog. Default: simulated.
defaultRequestSent{ adminId: string; sentAt: Date | number | string }Forbidden: opens on the request sent state.
onSwitchAccount() => voidForbidden: "Switch account". Default: a toast.
account{ name: string; email: string; avatar?: string; team?: string } | nullForbidden: who is signed in (Noah Hayes, Sales team); null hides the card and shows the home link instead of "Switch account".
logoReactNodePage layout: the header mark, default the Acme CRM logo.
footerReactNodeExtra content at the start of the footer links (inline layout: under the page).
autoFocusTitledefaulttruebooleanPage layout: the title takes focus when the page mounts after a navigation, never on the first load.
tonedefault"neutral"ToneThe primary actions, the illustration's accent, the countdown tiles and the retry bar.
radiusdefault"md""sm" | "md" | "lg"Panels, cards, tiles and buttons.
animateIndefaulttruebooleanThe illustration and the sections rise in once when the page mounts on the client (server html is already final).
labelsErrorPageLabelsInputEvery visible string, one group per variant plus common, validation, countdown, tracker and trackerStatuses: DEFAULT_ERROR_PAGE_LABELS (English) by default, ERROR_PAGE_LABELS_RO for the ready Romanian set.
localedefault"en-US"stringDates, times, numbers and the page language.
nowDate | numberThe reference time for relative times and the maintenance countdown (which then runs live from mount). Default useNow().
linkComponent(props: LinkComponentProps) => ReactNodeThe router link for every link (next/link); default <a>.
classNamesPartial<Record<ErrorPageSlot, string>>Classes for header, main, content, illustration, eyebrow, title, description, actions, extra, help and footer.
Parts
ErrorIllustration
componentThe theme-aware line art of each error kind, drawn in foreground tints with one accent in the tone color. Use it alone in your own empty or error screens.
DEFAULT_ERROR_PAGE_LABELS
constantEvery English string of the five screens, with the strings of the items they compose. Spread it and override what you translate.
ERROR_PAGE_LABELS_EN
constantAn alias of DEFAULT_ERROR_PAGE_LABELS, kept so older imports keep working.
ERROR_PAGE_LABELS_RO
constantA ready Romanian set of every string, including the Romanian strings of the composed items. Pass it as labels for a Romanian site.
ERROR_PAGE_SUGGESTIONS
constantThe default links of the not found screen (Dashboard, Clients, Invoices, Help), each with its icon. Replace it with your own popular pages.
ERROR_PAGE_OFFLINE_PAGES
constantThe default pages the offline screen lists as saved for offline reading, each with its icon.
withSuggestionIcons
functionTurns items whose icon is a key ("dashboard", "clients", "invoices", "help"...) into items with the matching icon, so suggestions can come from JSON or a CMS.
ERROR_PAGES_SAMPLE
constantThe demo content: suggestions, the sample error, offline pages, the status history, the admins and the signed in account. Replace it with your own data.
ERROR_PAGES_SAMPLE_EN
constantThe same demo content under its older name, kept so existing imports keep working.
Examples
Server error
500 with the technical details open; the first retry fails and shows the time, the second one works.
Scheduled maintenance
A live countdown to Sunday 04:00, the 30 day uptime bar and the notify-me form.
Offline
Retries every 10 seconds; the footer link fires the online event and the page comes back.
No access, request sent
The forbidden page after asking Ryan Brooks for access three minutes ago.
Inside the admin shell
layout="inline" fills the shell's main for a missing report at /reports/q5.
Brand tone
tone="brand" on the primary action and the compass needle, with larger radii.
Romanian copy
ERROR_PAGE_LABELS_RO with locale ro-RO on the forbidden page: the ready Romanian set for the page and its parts.
Dependencies
Files
- components/blocks/error-pages.tsx
- components/blocks/error-pages-data.ts
FAQ
Is the React Error Pages block free?
The preview, props and docs are free; copying the source needs a Pro plan. See plans.
How do I install Error Pages?
Run npx wingo-ui@latest add error-pages. It also adds the Wingo UI items it builds on (Marketing Section, Alert, Avatar, Badge, Button and 20 more) and the npm packages motion, lucide-react, react-hook-form and zod. With shadcn, add the @wingo-ui registry with your API key, then run npx shadcn@latest add @wingo-ui/error-pages.
How does Error Pages behave on phones?
The illustration rises in and the 404 compass needle swings and settles once; everything else fades up in order when the page mounts on the client (reduced motion keeps only short fades). 404: "Back to the home page" and "Go back" (history back, or home without history).
See also
More React blocks
Articles using this component
- React 404 Page: 5 Error Screens for the Next.js App Router
Build it: screens and apps11 min read