Skip to content
caliper ui docs

Pro

Connection banner

Says when the app lost its connection and what that means, counts down to the next try, and confirms when it is back.

Pro
pnpm dlx shadcn@latest add @caliper/connection-banner

October ledger

Changes save as you type and queue while you are offline

  • INV-2041 · Ostra Freight€4,800
  • INV-2040 · Northwind€1,250
Installs components/ui/connection-banner.tsxDepends on @radix-ui/react-slot, lucide-reactMotion shared motion tokens

When to use

Use it for

  • Apps that keep working offline or queue changes.
  • Realtime tools where a dropped connection loses updates.

Skip it when

  • Static sites; the browser already says so.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/connection-banner

Adds its 3 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { ConnectionBanner } from "@/components/ui/connection-banner"

The worked example comes with Pro

The 49-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

ConnectionBanner

component
PropTypeDefaultDescription
onlineboolean—Leave out to follow the browser's own online state.
onRetry(() => Promise<boolean>)—Checks the connection; resolve true when it is back.
offlineTextstring"You are offline. Changes are kept on this device and sync when you are back."
classNamestring—

Accessibility

It exposes status semantics, with aria-hidden kept in step with state. Changes that matter are announced through a live region.

No custom key handling; Tab and the native activation keys do the work.

Motion

Transitions use the shared duration and easing tokens. Under prefers-reduced-motion those tokens collapse to instant and travel distances go to zero, so state changes still happen without movement.

All Changing values examples