Retry spin
An error you retry with a flick: the arrow spins while the request is out and coasts to rest when it settles.
On this page
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
Usage
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
| Prop | Type | Notes |
|---|---|---|
status | "error" | "retrying" | "ok" | Ok fades it away |
message | string | What went wrong, and how to fix it |
onRetry | () => void | |
attempt | number | From 2 the line says Attempt n |
retryingLabel / retryLabel | string | Default 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.