Terms Changes

Terms Changes is a copy-paste React component that stops terms accepted without seeing changes 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/terms-changes
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

StopsTerms accepted without seeing changes

Was this component page useful?

How do I install Terms Changes?

pnpm dlx shadcn@latest add @bollard/terms-changes

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

How do I use Terms Changes in React?

terms-changes-usage.tsx
import { TermsChanges, type TermsAcceptance } from "@/components/ui/terms-changes"

<TermsChanges
  title="Terms of Service"
  accepted={{ version: "v2.1", text: v2, date: "4 Mar 2025" }}
  current={{ version: "v3.0", text: v3, date: "1 Nov 2026" }}
  summary={[
    "Full refunds now within 14 days instead of 30.",
    "Your uploads may improve recommendations unless you opt out.",
    "Disputes go to arbitration in Mumbai, not the Pune courts.",
  ]}
  onAccept={async (r) => {
    await new Promise((resolve) => setTimeout(resolve, 500))
    setRecord(r)
  }}
/>

What input mistakes does Terms Changes catch?

  • Every change since the accepted version, as a word diff
  • Changed numbers (fees, days, limits), called out
  • Changes not yet on screen for the dwell time
  • An early Accept tap, which jumps to the next unread change
  • Consent record with both versions, timestamp and changes seen

What props does Terms Changes accept?

TermsChanges props
PropTypeDefault
title* (required)

Document name, e.g. "Terms of Service".

string—
accepted* (required)

The version this person accepted last.

TermsVersion—
current* (required)

The version they're asked to accept.

TermsVersion—
summary* (required)

Plain-language bullets. They must match the wording changes shown below them.

string[]—
onAccept* (required)

Records consent. Return a promise to show a pending state; a rejection lets them try again.

(record: TermsAcceptance) => void | Promise<void>—
onDecline

Optional "Not now" action.

() => void—
dwell

How long (ms) a change must stay on screen to count as viewed, so scrolling past doesn't count.

number800
foldAfter

Unchanged runs longer than this many words are folded.

number80
headingText

Templates: `{title}`, `{from}`, `{fromDate}`, `{to}`, `{toDate}`, `{seen}`, `{total}`, `{count}` are filled in.

string"Our {title} changed"
introText

Intro line above the changes.

string"You accepted {from} ({fromDate}). Here's exactly what ch…
summaryLabel

Heading of the plain-language summary.

string"In short"
changesLabel

Accessible label of the changes region.

string"Exact wording changes"
progressText

Progress text. `{seen}` and `{total}` are filled in.

string"{seen} of {total} read"
nextLabel

Label of the jump-to-next-unread button.

string"Next change"
acceptLabel

Label of the Accept button.

string"Accept {to}"
remainingText

Says how many changes are still unread.

string"Read the highlighted changes first ({count} left)."
acceptedText

Shown after accepting.

string"You accepted {to}."
declineLabel

Label of the Decline button.

string"Not now"
foldText

Label for folded unchanged text.

string"{count} unchanged words"

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

How is Terms Changes accessible?

  • Changes region is focusable (tabIndex=0) with an aria-label
  • Removed/added text has sr-only prefixes; read changes marked with an aria-labelled check
  • Progress in a polite live region; Accept uses aria-disabled and is described by what's left
  • Scrolling jumps respect 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: Record consent server-side with the version ids and timestamp, and check the accepted version on later requests.

  • "Seen" means on screen for dwell ms, not read or understood
  • Not legal advice on what counts as valid consent in your jurisdiction
  • Store the consent record server-side yourself

What expensive mistakes does Terms Changes stop?

Terms accepted without seeing changes

Also known as

terms of service · privacy policy · tos update · accept terms · diff · consent · legal · dpdp

Field type

What dependencies does Terms Changes require?

Terms Changes facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameTerms Changes
Registry identifier@bollard/terms-changes
Install commandnpx shadcn@latest add @bollard/terms-changes
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 Terms Changes

What form validation mistake does Terms Changes catch?

Terms Changes prevents terms accepted without seeing changes. Shows what changed in updated terms since the version a user accepted, and keeps Accept locked until each change has been on screen. Catches: Every change since the accepted version, as a word diff, Changed numbers (fees, days, limits), called out, Changes not yet on screen for the dwell time, An early Accept tap, which jumps to the next unread change, Consent record with both versions, timestamp and changes seen. Limitation: validate terms-changes schemas on backend.

How do I install terms-changes with shadcn?

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

What props customize Terms Changes?

Terms Changes accepts `title`, `accepted`, `current`, `summary`, `onAccept`. Configures terms of service, privacy policy, tos update behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of terms-changes?

"Seen" means on screen for dwell ms, not read or understood. Not legal advice on what counts as valid consent in your jurisdiction. Store the consent record server-side yourself Server requirement: Record consent server-side with the version ids and timestamp, and check the accepted version on later requests.

How does Terms Changes meet accessibility guidelines?

Changes region is focusable (tabIndex=0) with an aria-label. Removed/added text has sr-only prefixes; read changes marked with an aria-labelled check. Progress in a polite live region; Accept uses aria-disabled and is described by what's left. Scrolling jumps respect reduced motion. Minimizes errors: updated terms no diff, accept terms blindly.

Which components pair with Terms Changes?