Offline Sync Queue
A split offline screen: a headline, a Retry pill button, and a self-restarting countdown that raises an attempt number each cycle on the left, beside a soft panel listing every pending change held on the device with a pulsing "Listening for connection" indicator on the right.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/offline-sync-queue.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/error/error31.tsx instead.
Usage
The file also exports error31Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Error31, error31Demo } from "@/components/blocks/error/error31"; export default function Page() { return <Error31 {...error31Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | ReactNode | "You're offline" | Main headline. |
| description | string | none | Short supporting copy under the headline. |
| retryLabel | string | "Retry" | Label for the retry pill button. |
| listeningLabel | string | "Listening for connection" | Label next to the pulsing connection indicator. |
| pendingChanges | string[] | none | Fixed list of change descriptions shown as held on the device, waiting to sync. |
| className | string | none | Extra classes for the outer section element. |
Behavior notes
- The countdown is real client state: a useEffect-driven setTimeout counts secondsLeft down from a fixed literal (15), and once it hits zero it resets to 15 and increments the attempt number, over and over, exactly the self-restarting pattern of a real offline reconnect loop (with no real network check behind it).
- The Retry button is also real: clicking it manually resets secondsLeft to 15 and bumps the attempt counter, the same transition the countdown performs automatically.
- The pulsing "Listening for connection" dot is pure CSS (animate-pulse), not driven by any timer or real connectivity check.
- The pending-changes list is static demo data representing a device's local sync queue; there's no real storage or sync behind it, removing or completing an item is not implemented since the brief only asks for the queue's fixed contents.
More Error Blocks
View all →centered-404-message
Centered 404 Message
Minimal centered 404 with two CTAs and a divided row of popular page links.
404-with-site-search
404 With Site Search
404 screen with a working search box and a bordered list of suggested pages.
split-404-with-image
Split 404 With Image
Two-column 404 with the message on one side and a full-bleed photo that scales on hover on the other.
404-with-destination-cards
404 With Destination Cards
404 screen with a grid of icon destination cards plus fallback CTA buttons.
404-support-panel
404 Support Panel
Card-style 404 echoing the requested URL, with a real back button and a support/status link row.
inline-404-line
Inline 404 Line
The smallest possible 404: code and message on one divided line with one button underneath.