404 With Redirect Countdown

404 page that counts down to an automatic redirect and calls onRedirect once it reaches zero, with a cancel button that stops the timer and a manual go-now link.

FREE

Error8: 404 With Redirect Countdown

A 404 page that does not wait for the visitor to act: a live countdown runs under the message and fires onRedirect when it reaches zero, with a cancel button that stops the timer for anyone who would rather stay.

Free block

This block is free. No license or account is required: install it with the CLI and use it in unlimited projects.

Installation

Radix flavor

bash
npx shadcn add "https://ui.beste.co/r/error8"

Base UI flavor

bash
npx shadcn add "https://ui.beste.co/r-base/error8"

This installs the block to components/beste/block/error8.tsx, plus the button shadcn/ui primitive it uses for the manual and cancel actions.

Quick start

The installed file exports error8Demo alongside the block: the exact props behind the preview above. Spread it and the countdown runs immediately.

tsx
import { Error8, error8Demo } from "@/components/beste/block/error8";

export default function NotFound() {
  return <Error8 {...error8Demo} />;
}

Navigation is the caller's job, so wire onRedirect to your router:

tsx
"use client";

import { useRouter } from "next/navigation";
import { Error8 } from "@/components/beste/block/error8";

export default function NotFound() {
  const router = useRouter();

  return (
    <Error8
      code="404"
      heading="This page does not exist"
      description="We will take you somewhere useful unless you would rather stay."
      seconds={10}
      labels={{
        redirect: "Redirecting to the homepage in",
        seconds: "seconds",
        cancel: "Stay on this page",
        canceled: "Automatic redirect canceled.",
      }}
      action={{ label: "Go now", href: "/" }}
      onRedirect={() => router.push("/")}
    />
  );
}

Props

PropTypeDefaultDescription
codestringSmall uppercase status label above the heading
headingstringMain page heading, rendered as an h1
descriptionstringExplanatory paragraph under the heading
secondsnumberStarting value of the countdown
labelsError8Labels{}Countdown sentence, unit word, cancel button text, and canceled message
actionActionLinkManual link button beside the cancel button
onRedirect() => voidCalled once when the countdown reaches zero
classNamestringExtra classes for the outer <section>
ts
type Error8Labels = {
  redirect?: string;
  seconds?: string;
  cancel?: string;
  canceled?: string;
};

type ActionLink = {
  label: string;
  href: string;
};

Behavior notes

More Error blocks

View all Error
FREE

error2

404 With Site Search

Search-first 404 page: a controlled search field with a submit handler, plus a bordered list of suggested pages with titles, descriptions, and hover arrows.

PRO

error4

404 With Destination Cards

404 page that recovers the visit with a grid of destination cards, each with an icon, title, description, and hover arrow, followed by a centered row of fallback buttons.

PRO

error25

Rate Limit Cooldown

Too-many-requests page with a square eyebrow and status code, an accent headline, three bordered usage cells, and a live cooldown counter that swaps itself for a retry seal button when it reaches zero.

PRO

error13

404 With Site Directory

404 page that doubles as a sitemap: left-aligned messaging over four columns of grouped section links, so visitors on a large site can jump straight to the area they wanted.

PRO

error5

404 Support Panel

Card-style 404 panel that echoes the requested URL in monospace, pairs a browser-history back button with link actions, and closes with a support and status link row.

FREE

error1

Centered 404 Message

Minimal centered 404 page with a large error code, a heading, a short explanation, two call-to-action buttons, and a divided row of popular page links underneath.