Revision Banner

Revision Banner is a copy-paste React component that stops edited an old version by mistake 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/revision-banner
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

StopsEdited an old version by mistake

Was this component page useful?

How do I install Revision Banner?

pnpm dlx shadcn@latest add @bollard/revision-banner

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

What input mistakes does Revision Banner catch?

  • Viewing an old revision, said up front with how far behind it is
  • Edit attempts on the old version, explained instead of silently ignored
  • Restore impact: which version it replaces and words changed
  • Restore errors, with the latest kept

What props does Revision Banner accept?

RevisionBanner props
PropTypeDefault
revision* (required)

The old revision on screen.

RevisionInfo—
latest* (required)

The current, latest revision.

RevisionInfo—
behind

How many revisions newer than this one exist.

number—
revisionText

Plain text of both revisions, to count the words a restore would change.

string—
latestText

Text describing the latest version.

string—
onGoToLatest* (required)

Open the latest revision.

() => void—
onRestore* (required)

Make this revision the latest. Return a promise to show progress; a rejection shows `errorText`.

() => void | Promise<void>—
children* (required)

The old revision's content. Edits inside it are blocked.

React.ReactNode—
formatDate

Formats revision dates.

(date: Date) => stringdefaultFormatDate
message

Templates: `{label}`, `{author}`, `{date}`, `{behind}`, `{latest}`, `{added}`, `{removed}` are filled in.

string"You're viewing {label} from {date}{author}. This isn't t…
behindText

Says how many versions behind this one is.

string"{behind} newer {versions} saved since"
editBlockedText

Shown when someone tries to edit the old version.

string"Old versions are read-only. Go to the latest to edit, or…
confirmText

Restore confirmation question.

string"Restore {label}? It replaces {latest}{latestAuthor}, sav…
impactText

Says how many words the restore changes.

string"{removed} removed, {added} brought back."
keptText

Says the latest version is kept in history.

string"{latest} stays in history, so you can undo this."
goToLatestLabel

Label of the go-to-latest button.

string"Go to latest"
restoreLabel

Label of the restore button.

string"Restore this version"
confirmRestoreLabel

Label of the confirm-restore button.

string"Replace with {label}"
cancelLabel

Label of the Cancel button.

string"Cancel"
errorText

Shown when onRestore rejects.

string"Couldn't restore. Nothing was changed."

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

How is Revision Banner accessible?

  • Banner is a region with an aria-label naming the version
  • Content frame is role=group with aria-readonly and an aria-label
  • Restore confirmation focuses Cancel first; Escape closes it
  • Blocked-edit note in a polite live region; errors use role=alert

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

What are the limitations and server boundaries?

  • Read-only framing is visual and ARIA; it does not disable editors you render inside
  • Word-change count comes from what you pass

What expensive mistakes does Revision Banner stop?

Edited an old version by mistake

Also known as

version history · revision · restore version · document history · read only · docs · wiki · cms

Field type

What dependencies does Revision Banner require?

Revision Banner facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameRevision Banner
Registry identifier@bollard/revision-banner
Install commandnpx shadcn@latest add @bollard/revision-banner
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 Revision Banner

What form validation mistake does Revision Banner catch?

Revision Banner prevents edited an old version by mistake. Makes an old revision unmistakable and read-only, and confirms what "Restore this version" replaces before it does. Catches: Viewing an old revision, said up front with how far behind it is, Edit attempts on the old version, explained instead of silently ignored, Restore impact: which version it replaces and words changed, Restore errors, with the latest kept. Limitation: validate revision-banner schemas on backend.

How do I install revision-banner with shadcn?

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

What props customize Revision Banner?

Revision Banner accepts `revision`, `latest`, `behind`, `revisionText`, `latestText`. Configures version history, revision, restore version behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of revision-banner?

Read-only framing is visual and ARIA; it does not disable editors you render inside. Word-change count comes from what you pass Server requirement: backend verification for revision-banner.

How does Revision Banner meet accessibility guidelines?

Banner is a region with an aria-label naming the version. Content frame is role=group with aria-readonly and an aria-label. Restore confirmation focuses Cancel first; Escape closes it. Blocked-edit note in a polite live region; errors use role=alert. Minimizes errors: edited old revision, restored wrong version.

Which components pair with Revision Banner?