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-pagesFor Claude Code, Cursor or Codex: installs it and wires the props to your own data.
Paste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install prompt
Install Error Pages from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/error-pages
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add error-pages
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- components/ui/knowns/kbd.tsx
- components/ui/knowns/field-class.ts
- components/ui/knowns/textarea.tsx
- components/ui/knowns/chat-composer/use-autosize.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/input.tsx
- components/ui/knowns/blocks/error/error-pages.tsx
- components/ui/knowns/blocks/error/error-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/error-pages, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "error-pages" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.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- Default
per page - Plain words: what happened and what to do next.
- fullHeight
boolean- Default
true - 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| 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 | per page | Plain words: what happened and what to do next. |
| fullHeight | boolean | true | Centre in the viewport height (minus a 64px header), or only in the parent. |
| as | "h1" | "h2" | "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.
| Prop | Type | Default | Description |
|---|---|---|---|
| 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 } | [] / / | 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
- 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.
- 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.
- 03Retries the 500 page with `onRetry` and shows a spinner on the button while the returned promise settles.
- 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.
- 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.
- 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
| State | What moves | Timing |
|---|---|---|
| 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" }).