Reconnect strip
The connection, said once: offline slides an amber strip down, reconnecting turns it blue, back online turns it green and away.
On this page
Offline slides an amber strip down with the seconds to the next try; reconnecting turns it blue as the signal arcs light; back online turns it green and it slides away.
Losing the connection slides a slim amber strip down from the top edge of the thread with the seconds to the next try and a way to try now. While it reconnects the strip turns blue and the signal arcs light one after another from the centre out. When it is back it turns green, says Back online with a check and slides away by itself. It never stacks.
Installation
Usage
import { ReconnectStrip } from "@/components/ui/chatcn/reconnect-strip"
<ReconnectStrip status={connection} retryIn={secondsToRetry} onRetryNow={reconnect} onSettled={() => setConnection("online")} />Examples
States
The strip in each state, held still: amber offline with the countdown, blue reconnecting, green back online.
Props
| Prop | Type | Notes |
|---|---|---|
status | "online" | "offline" | "connecting" | "restored" | Online renders nothing |
retryIn | number | Seconds to the next try, while offline |
onRetryNow | () => void | Shows Try now |
restoredMs | number | How long Back online stays. Default 1800 |
onSettled | () => void | After the restored strip has gone |
Accessibility
- A polite
role="status": each change is read once.
Motion
- Slides in 420 ms, out 320 ms; colours cross fade 300 ms. The arcs fade in sequence, 180 ms apart. Reduced motion: fades and still arcs.