Components
Status Page
NativeWhole-page messages: not found, server error, no access and maintenance.
This page does not exist
The link may be old, or the page may have moved. Check the address, or start again from the home page.
Installation
npx nook-ui@latest add status-pagePrompt
Paste this into your AI coding assistant. It adds this exact component, the same way the CLI does, and tells the assistant how to use it.
Short. For assistants that can run commands in your project.
Add the Nook "Status Page" component to this project, exactly as Nook ships it.
Whole-page messages: not found, server error, no access and maintenance.
Steps
1. Check for `nook.json` in the project root. If it is missing, run `npx nook-ui@latest init` first (React or Next.js with Tailwind CSS v4). It adds the Nook tokens, the theme and `cn()`.
2. Run `npx nook-ui@latest add status-page`. It writes `components/ui/status-page.tsx` together with everything the component needs. Do not write the component from memory.
3. If you cannot run commands, fetch http://localhost:3000/r/status-page.json, write every entry of `files` to the path it names, install the packages in `dependencies`, and repeat for each name in `registryDependencies`.
4. Use it where I ask. Start from this example:
```tsx
import { Button } from "@/components/ui/button";
import { StatusActions, StatusCode, StatusDescription, StatusPage, StatusTitle } from "@/components/ui/status-page";
export default function StatusPageNotFound() {
return (
<StatusPage>
<StatusCode code={404} />
<StatusTitle as="h3">This page does not exist</StatusTitle>
<StatusDescription>The link may be old, or the page may have moved. Check the address, or start again from the home page.</StatusDescription>
<StatusActions>
<Button>Go to the home page</Button>
<Button variant="outline">Search the docs</Button>
</StatusActions>
</StatusPage>
);
}
```
API
- `StatusPage`: The container.
- `StatusCode`: The number, drawn in square dots.
- `code` (`number | string`): Such as 404 or 500.
- `StatusTitle`: What happened.
- `as` (`"h1" | "h2" | "h3"`, default "h1"): The heading level.
- `StatusDescription, StatusActions, StatusMeta`: What to do next, the buttons, and a reference to quote to support.
Rules
- Colors, radii, shadows and motion come from Nook tokens and classes such as `bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg` and `h-control`. Never hard-code them.
- Do not restyle or simplify the file. Change how it looks through `className`, its props and the theme.
- It must keep working with the keyboard, in light and dark mode, and in the sharp, soft and bold styles.
- Accessibility: The code is an image named Error 404. The title says what happened and the description says what to do next, so nobody is left with a bare number.
Done when the component renders like the example in light and dark mode and the project type-checks.Usage
import { Button } from "@/components/ui/button";
import { StatusActions, StatusCode, StatusDescription, StatusPage, StatusTitle } from "@/components/ui/status-page";
export default function StatusPageNotFound() {
return (
<StatusPage>
<StatusCode code={404} />
<StatusTitle as="h3">This page does not exist</StatusTitle>
<StatusDescription>The link may be old, or the page may have moved. Check the address, or start again from the home page.</StatusDescription>
<StatusActions>
<Button>Go to the home page</Button>
<Button variant="outline">Search the docs</Button>
</StatusActions>
</StatusPage>
);
}Examples
500: server error
Something went wrong on our side
Your work is saved. Try again in a moment; if it keeps happening, send us the reference below.
Reference: req_8f3a21c9
403: no access
You do not have access to this workspace
You are signed in as maya@acme.com. Ask a workspace admin to invite you, or switch to another account.
Maintenance
We are down for planned maintenance
We are moving to faster servers. Nothing is lost, and we expect to be back at 03:00 UTC.
You are offline
You are offline
We cannot reach the internet. Your changes are kept on this device and will sync when you are back online.
Props
StatusPage
The container.
StatusCode
The number, drawn in square dots.
| Prop | Type | Default | Description |
|---|---|---|---|
| code | number | string | – | Such as 404 or 500. |
StatusTitle
What happened.
| Prop | Type | Default | Description |
|---|---|---|---|
| as | "h1" | "h2" | "h3" | "h1" | The heading level. |
StatusDescription, StatusActions, StatusMeta
What to do next, the buttons, and a reference to quote to support.
Accessibility
The code is an image named Error 404. The title says what happened and the description says what to do next, so nobody is left with a bare number.
Checked against WCAG 2.1 AA with automated axe tests and keyboard tests on every release.