Page problem
Takes the place of a page that could not load: what happened in plain words, and the one way on, such as Try again or Sign in again.
Examples
Could not load this page
The server could not finish the request. Try again in a moment.
Could not load this page
The server could not finish the request. Try again in a moment.
This took too long to load
The server did not answer in time. Trying again usually works.
You are offline
Connect to the internet, then try again.
Usage
Use it when
- A page has nothing to show because its first read failed: a record that is gone, a session that ended, no network.
- A whole route's loader or error boundary fails, in a product with a router.
Use something else when
- A list or a section inside a page failed while the rest loaded. Use Empty instead, with
reason="error". - The page shows data and a later read failed. Use Banner instead, or a toast, and keep the data.
- A form could not save. Use Field's error and StateButton instead.
Rules
General
Content
Avoid
Limits
Install
npx shadcn@latest add https://kaanarici.com/r/cobalt/page-problem.json https://kaanarici.com/r/cobalt/long-wait-notice.json https://kaanarici.com/r/cobalt/failure.json https://kaanarici.com/r/cobalt/use-long-wait.jsonimport { PageProblem, pageProblemLabels, type PageProblemLabels } from "@/components/cobalt/ui/page-problem"import { LongWaitNotice } from "@/components/cobalt/ui/long-wait-notice"import { Failure, Unconfirmed, failureOf, failureWords, wordsFor } from "@/lib/cobalt/failure"import { useLongWait } from "@/lib/cobalt/use-long-wait"