Skip to content
Sign upGet access
MicrointeractionsReconnect stripMenu

Reconnect strip

The connection, said once: offline slides an amber strip down, reconnecting turns it blue, back online turns it green and away.

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

$ pnpm dlx shadcn@latest add https://chatcn.dev/r/reconnect-strip.json

Usage

tsx
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

PropTypeNotes
status"online" | "offline" | "connecting" | "restored"Online renders nothing
retryInnumberSeconds to the next try, while offline
onRetryNow() => voidShows Try now
restoredMsnumberHow long Back online stays. Default 1800
onSettled() => voidAfter 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.