Irreversible Diff Badge

Irreversible Diff Badge is a copy-paste React component that stops permanent field changed without warning 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/irreversible-diff-badge
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

StopsPermanent field changed without warning

Was this component page useful?

How do I install Irreversible Diff Badge?

pnpm dlx shadcn@latest add @bollard/irreversible-diff-badge

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

How do I use Irreversible Diff Badge in React?

irreversible-diff-badge-usage.tsx
import { IrreversibleBadge, IrreversibleDiffSummary, type IrreversibleField } from "@/components/ui/irreversible-diff-badge"

Username <IrreversibleBadge severity="limited" changed={changed("username")} />

What input mistakes does Irreversible Diff Badge catch?

  • Permanent or rarely changeable fields edited without notice
  • Readback of only the hard-to-undo fields that changed, with consequences
  • Confirmation given for one set of changes reused for another: it resets
  • One-tap Revert per field

What props does Irreversible Diff Badge accept?

IrreversibleBadge props
PropTypeDefault
changed

Whether the field has been changed from its saved value. Unchanged shows a quiet lock; changed turns amber.

boolean—
severity

Same meaning as on IrreversibleField.

"permanent" | "limited""permanent"
messages

Visible strings.

Partial<Pick<IrreversibleMessages, "permanent" | "limited" | "changed">>—

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

How is Irreversible Diff Badge accessible?

  • Readback is a labelled group described by the change list
  • Changes are announced in a polite live region; from/to are read as text, with del/ins visuals aria-hidden
  • Revert buttons have aria-labels naming the field and old value; focus moves after a revert
  • Save 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?

This is a UX guard rail. Enforce on the server: Enforce which fields are immutable on the server and audit-log changes to them.

  • You decide which fields are permanent; it can't know
  • Comparison uses your equals or a strict/JSON comparison

What expensive mistakes does Irreversible Diff Badge stop?

Permanent field changed without warning

Also known as

username · slug · handle · permanent · readonly after save · profile settings · subdomain · diff

Field type

What dependencies does Irreversible Diff Badge require?

Irreversible Diff Badge facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameIrreversible Diff Badge
Registry identifier@bollard/irreversible-diff-badge
Install commandnpx shadcn@latest add @bollard/irreversible-diff-badge
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 Irreversible Diff Badge

What form validation mistake does Irreversible Diff Badge catch?

Irreversible Diff Badge prevents permanent field changed without warning. Marks fields that can't be changed back and, before save, lists only the permanent fields that actually changed, from → to. Catches: Permanent or rarely changeable fields edited without notice, Readback of only the hard-to-undo fields that changed, with consequences, Confirmation given for one set of changes reused for another: it resets, One-tap Revert per field. Limitation: validate irreversible-diff-badge schemas on backend.

How do I install irreversible-diff-badge with shadcn?

Run `npx shadcn@latest add @bollard/irreversible-diff-badge`. Sources added: registry/default/irreversible-diff-badge/irreversible-changes.ts, registry/default/irreversible-diff-badge/irreversible-diff-badge.tsx. Package requirements: lucide-react.

What props customize Irreversible Diff Badge?

Irreversible Diff Badge accepts `changed`, `severity`, `messages`. Configures username, slug, handle behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of irreversible-diff-badge?

You decide which fields are permanent; it can't know. Comparison uses your equals or a strict/JSON comparison Server requirement: Enforce which fields are immutable on the server and audit-log changes to them.

How does Irreversible Diff Badge meet accessibility guidelines?

Readback is a labelled group described by the change list. Changes are announced in a polite live region; from/to are read as text, with del/ins visuals aria-hidden. Revert buttons have aria-labels naming the field and old value; focus moves after a revert. Save errors use role=alert. Minimizes errors: changed username cant undo, permanent field edited.

Which components pair with Irreversible Diff Badge?