ns-ui
A retry button that visibly winds a torsion spring through its backoff — disabled and charging while a --foreground arc grows on real timing, notching every failure, pressable only once fully wound.
Use when a retry the user presses where the wait must be honest, the button genuinely disabled while a torsion arc winds on the real computed backoff timing and notches on every failure; pick button-cooldown-heat instead when the limit is driven by the user's own click rate rather than by a server's backoff schedule, or autosave-ratchet when the save retries itself and there is no button to press.
Install
npx shadcn add https://design.helpmarq.com /r/button-retry-backoff.jsonns-ui / button-retry-backoff — rate-limited retry
Ready
| Prop | Type | Default | Description |
|---|---|---|---|
| onRetry? | () => Promise<boolean> | boolean | — | called when the user presses Retry once idle/charged; resolve/return false (or throw) to report failure, anything else counts as success |
| baseDelayMs? | number | — | wind duration for the first failure, ms (default 4000 — a real cooldown) |
| factor? | number | — | multiplier applied per additional consecutive failure (default 2) |
| maxDelayMs? | number | — | upper bound on wind duration regardless of attempt count (default 60000) |
| maxNotches? | number | — | fixed angular slots the ring can notch before saturating (default 8) — the attempt count in the text description is never capped, only the ring |
| label? | string | — | button label in the idle/charged state (default "Retry") |
| className? | string | — | — |