Usage
import { ExceptionPage } from './ExceptionPage.jsx'
// One variant per route: app/not-found.jsx, a 403 from the server, an error boundary, a failed load.
<ExceptionPage
locale="en"
variant="server-error" // 'not-found' | 'no-access' | 'server-error' | 'offline'
reference={error.digest}
onSearch={(words) => router.push('/search?q=' + encodeURIComponent(words))}
onAction={async (variant, which) => {
if (variant === 'server-error' && which === 'primary') return reset()
if (variant === 'offline' && which === 'primary') return await reload() // false keeps counting down
if (variant === 'not-found' && which === 'primary') router.push('/')
}}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the built-in text. |
variant | 'not-found' | 'no-access' | 'server-error' | 'offline' | — | Which page to show. Without it, a segmented control switches between all four. |
reference | string | — | The request or error id a server error shows, with a copy button. |
retryIn | number | 10 | Seconds between automatic retries when offline. |
onAction | (variant, which: 'primary' | 'secondary' | 'link', link?) => Promise<boolean | void> | void | — | An action was pressed. Resolve false to say it did not work (offline then keeps counting down). |
onSearch | (words: string) => void | — | The not-found search was sent. |
labels | object | — | Replaces any built-in text (keys as in copy.js). |
Add it to your project
Copy the prompt into Codex or Claude Code. The agent reads the published source, shows you what it will write and adds the block together with the components it is built from.
ExceptionPage.jsxexception-page.csscopy.jskit.jsxkit.cssui/base-button/ui/copy-button/ui/text-input/ui/segmented-control/tokens.cssREADME.md
The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.