Skip to content

Error Pages

404 with search and popular links, 500 with retry, a status link and a copyable error ID, and Maintenance with a live ETA and a notify-me form. Each takes an illustration; the Empty States drawings fit.

On this page
Used for
  • 404 not found page
  • 500 server error
  • Planned maintenance page
  • Failed run fallback
  • Error ID for support

Examples

500

Maintenance

Installation

npx knowns-ui@latest add error-pages
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

art
ReactNode
An illustration about 160px tall, above the title. The Empty States drawings with title and description set to null fit.
title / description
ReactNode
Defaultper page
Plain words: what happened and what to do next.
fullHeight
boolean
Defaulttrue
Centre in the viewport height (minus a 64px header), or only in the parent.
as
"h1" | "h2"
Default"h1"
Heading level of the title. Use h2 when the page sits inside another page, such as a docs demo.
search
{ action?, onSearch?, placeholder?, label? }
404: a labelled search form. action submits to ?q=; onSearch hands you the query.
links / home
{ label, href, description? }[] / { label?, href }
Default[] / /
404: popular destinations, then a link home.
onRetry
() => unknown
500: Try again; a returned promise shows a spinner until it settles.
errorId / statusHref / supportHref
string
500: the id with a Copy button (copies the id, page and time), the status page and support.
eta / locale
Date | string | number / string
Maintenance: shown as "back in about 40 minutes, around 2:30 PM" and updated every 30 seconds, after the page loads in the reader's timezone.
subscribe
{ onSubscribe, placeholder?, button?, thanks? }
Maintenance: an email field; a thrown message shows under it.

What it handles

  1. 01Shares one ErrorLayout across three pages: an `art` slot about 160px tall, a code, a title, a description, actions and a footer line, centred and readable at 360px.
  2. 02Builds the 404 search box as a real form that submits to `${action}?q=` through searchUrl, or hands the query to `onSearch`, and lists three to six popular links.
  3. 03Retries the 500 page with `onRetry` and shows a spinner on the button while the returned promise settles.
  4. 04Copies an error report on the 500 page with the error ID, the page path and an ISO time, and the Copy link reads Copied for about a second and a half.
  5. 05Turns the maintenance `eta` into a clock time and "in about 40 minutes" through etaText, rounds it, and refreshes it every 30 seconds after mount.
  6. 06Validates the notify-me email with isEmail, shows the thrown message under the field when `onSubscribe` fails, and swaps the form for a thanks line once it succeeds.

States

First render
Nothing. The page paints as it is; the ETA reads Checking the time until mount
none
Hover a popular link
The arrow nudges to the right
120ms, ease out
ETA refresh
The relative time and the clock are recalculated
every 30s, no animation
Retry
The button shows its spinner until the promise settles
none
Error ID copied
The Copy link reads Copied, then goes back
none
Subscribe fails
An alert with the message appears under the field
none

Works with

When to use

When to use

  • Your 404 with search and popular links, so a dead link still leads somewhere.
  • A 500 with retry and an error ID people can paste into a support request.
  • Planned downtime with a live ETA and a way to hear when it is back.

When not to use

  • A list or search with nothing in it yet: use Empty States.
  • A failed action the page can recover from: use Toast.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Error Pages to my app and wire it to my own data.
  • I need your 404 with search and popular links, so a dead link still leads somewhere. Set that up with the Knowns UI Error Pages.
  • Which Error Pages props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "error-pages" }) and search_docs({ query: "error pages" }).

Need help?

Stuck on Error Pages, or found something off? We read every message.