Skip to content
Sign upGet access
MicrointeractionsRetry spinMenu

Retry spin

An error you retry with a flick: the arrow spins while the request is out and coasts to rest when it settles.

Press Retry and the arrow leaps into a spin that keeps turning while the request is out, then coasts to rest when it settles.

Press Retry and the arrow is given a spin: it leaps forward and keeps turning while the request is out, never slower than a steady idle; when the request settles, friction takes over and it coasts to rest upright. The message line edits in place, from the error to Retrying to what comes next, and counts attempts from the second one.

Installation

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

Usage

tsx
import { RetrySpin } from "@/components/ui/chatcn/retry-spin"

<RetrySpin status={status} attempt={attempt} message="The model is overloaded right now." onRetry={retry} />

Examples

States

The error with its retry, then the second attempt spinning. Once it works the line clears itself.

Props

PropTypeNotes
status"error" | "retrying" | "ok"Ok fades it away
messagestringWhat went wrong, and how to fix it
onRetry() => void
attemptnumberFrom 2 the line says Attempt n
retryingLabel / retryLabelstringDefault Retrying and Retry

Accessibility

  • role="alert": the error is announced; the button is a plain labelled button.

Motion

  • The spin is a velocity with friction and an idle floor; the rest is a critically damped spring to the next upright turn.
  • Reduced motion: no spin; the label still changes.