Rollback Preview

Rollback Preview is a copy-paste React component that stops rollback skipped more versions than expected before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/rollback-preview
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsRollback skipped more versions than expected

Was this component page useful?

How do I install Rollback Preview?

pnpm dlx shadcn@latest add @bollard/rollback-preview

The files land in your project. They're yours to edit.

How do I use Rollback Preview in React?

rollback-preview-usage.tsx
import { RollbackPreview } from "@/components/ui/rollback-preview"

<RollbackPreview
  className="max-w-md"
  current={{ id: "v42", deployedAt: times.current, label: "Gift notes" }}
  target={{ id: "v40", deployedAt: times.target, label: "Pricing page v2" }}
  skipped={[{ id: "v41", deployedAt: times.v41 }]}
  reverts={["Gift notes at checkout (v42)", "Faster search index (v41)", "PAYMENTS_TIMEOUT 8s → 20s"]}
  stays={["Migration 0193 dropped orders.legacy_code", "1,204 webhooks already sent to Shiprocket"]}
  written={[{ label: "orders", count: 318, note: "v40 ignores their gift notes" }, { label: "sign-ups", count: 52 }]}
  onConfirm={() => new Promise<void>((resolve) => setTimeout(() => (setDone(true), resolve()), 700))}
/>

What input mistakes does Rollback Preview catch?

  • Changes that revert, listed
  • What stays: irreversible migrations and data written since, with consequences
  • Newer versions the rollback skips
  • Typed name that matches a different version ("v4" for "v40")
  • Case and whitespace differences, normalised ("V40 " matches "v40")

What props does Rollback Preview accept?

RollbackPreview props
PropTypeDefault
current* (required)

What is live now.

RollbackVersion—
target* (required)

The version you are rolling back to.

RollbackVersion—
skipped

Versions between target and current that also get undone, newest first.

RollbackVersion[][]
reverts* (required)

Changes the rollback takes away, e.g. "Gift notes at checkout".

string[]—
stays

Things the rollback does NOT undo, e.g. irreversible migrations, sent webhooks, env vars.

string[][]
written

Data written after the target went out, which the old version will have to live with.

RollbackWritten[][]
onConfirm* (required)

Runs the rollback. Return a promise to show a pending state; a rejection re-enables the button.

() => void | Promise<void>—
title

Heading of the preview.

string"Roll back {current} → {target}"
targetMeta

`{age}` and `{count}` (skipped versions) are filled in.

string"{target} went out {age} ago"
skippedText

Says which newer versions the rollback skips.

string"Also undoes {skipped}"
revertsLabel

Heading of the list of changes that revert.

string"Reverts"
staysLabel

Heading of the list of things that won't undo.

string"Won't undo"
writtenLabel

Says what data was written since the target went out.

string"Written since {target}"
confirmLabel

`{target}` is filled in.

string"Roll back to {target}"
inputLabel

Label of the type-the-name input.

string"Type {target} to confirm"
wrongVersionText

Shown when the typed id is another version, `{typed}` and `{target}` filled in.

string"{typed} isn't the target. You're rolling back to {target}."
pendingLabel

Confirm label while onConfirm runs.

string"Rolling back…"

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Rollback Preview accessible?

  • Name input has a <label>, aria-invalid on a wrong version and a polite hint via aria-describedby
  • Enter in the input confirms when it matches
  • Confirm sets aria-busy while pending
  • Sections use icons plus text counts; motion skipped under reduced motion

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Authorize the rollback server-side and check that the target is still deployable (schema compatibility) before running it.

  • Lists only what you pass; it cannot inspect your deploys or migrations
  • Typing a name proves attention, not authorization

What expensive mistakes does Rollback Preview stop?

Rollback skipped more versions than expected

Also known as

rollback · revert deploy · redeploy · release · vercel · version history · deployment · downgrade

Field type

What dependencies does Rollback Preview require?

Rollback Preview facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameRollback Preview
Registry identifier@bollard/rollback-preview
Install commandnpx shadcn@latest add @bollard/rollback-preview
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Rollback Preview

How does Rollback Preview protect destructive mutations?

Rollback Preview prevents rollback skipped more versions than expected. Enforces deliberate friction against Changes that revert, listed, What stays: irreversible migrations and data written since, with consequences, Newer versions the rollback skips, Typed name that matches a different version ("v4" for "v40"), Case and whitespace differences, normalised ("V40 " matches "v40"). Limitation: authorize rollback-preview mutations on the server.

How do I install rollback-preview with shadcn?

Run `npx shadcn@latest add @bollard/rollback-preview`. Sources added: registry/default/rollback-preview/rollback-preview.tsx. Package requirements: lucide-react.

What props customize Rollback Preview?

Rollback Preview accepts `current`, `target`, `skipped`, `reverts`, `stays`. Configures rollback, revert deploy, redeploy behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of rollback-preview?

Lists only what you pass; it cannot inspect your deploys or migrations. Typing a name proves attention, not authorization Server requirement: Authorize the rollback server-side and check that the target is still deployable (schema compatibility) before running it.

How does Rollback Preview meet accessibility guidelines?

Name input has a <label>, aria-invalid on a wrong version and a polite hint via aria-describedby. Enter in the input confirms when it matches. Confirm sets aria-busy while pending. Sections use icons plus text counts; motion skipped under reduced motion. Minimizes errors: rollback reverted too much, rolled back wrong version.

Which components pair with Rollback Preview?