Pro
Undo rewind
The bar that follows a destructive action: what happened, an Undo button and a ring that drains over the time you have left. Ctrl or Cmd Z undoes it too.
pnpm dlx shadcn@latest add @caliper/undo-rewindWhen to use
Use it for
- Deleting rows, moving items and bulk edits that you can safely delay.
- Anywhere a confirm dialog would add friction to a common action.
Skip it when
- Actions that cannot be delayed or reversed; confirm those first with an alert dialog.
- Several overlapping undos; offer one at a time.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- It only offers the undo
- You remove the row on delete, put it back in onUndo and finish the delete in onExpire. The bar owns the time, the key and the announcement, not your data.
- The key never fights typing
- Ctrl or Cmd Z undoes the action unless focus is in a field, where it keeps undoing text.
Styling
- The ring says how long, the number says it too
- The ring drains anticlockwise; under reduced motion it holds still and the countdown number carries the time.
Installation
pnpm dlx shadcn@latest add @caliper/undo-rewind
Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage
Import it from your copy of the source. The example behind the preview comes with the source.
import { UndoRewind } from "@/components/ui/undo-rewind"
The worked example comes with Pro
The 67-line example behind the preview opens here, ready to copy.
- 626 Pro parts, blocks and page templates, all with source
- $149 once, with lifetime updates. No renewal
- A full refund within 14 days if it is not for you
API reference
UndoRewind
component
Accessibility
It exposes status semantics, with aria-hidden kept in step with state. Changes that matter are announced through a live region.
No custom key handling; Tab and the native activation keys do the work.
Motion
Transitions use the shared duration and easing tokens. Under prefers-reduced-motion those tokens collapse to instant and travel distances go to zero, so state changes still happen without movement.
Related
- ToastA short, dismissible message that confirms an action, with an optional undo.
- Alert dialogThe Dialog surface for a decision that cannot be undone: no close button, no outside dismiss, focus starting on the safe choice.
- Animated listA list whose rows come and go gracefully: new rows open into place, removed rows close their gap and the rest glide to their new positions.