Cancel Readback

Cancel Readback is a copy-paste React component that stops cancelled without knowing when access ends 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/cancel-readback
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

StopsCancelled without knowing when access ends

Was this component page useful?

How do I install Cancel Readback?

pnpm dlx shadcn@latest add @bollard/cancel-readback

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

How do I use Cancel Readback in React?

cancel-readback-usage.tsx
import { CancelReadback } from "@/components/ui/cancel-readback"

<CancelReadback
  plan="Pro"
  accessEndsAt={endsAt}
  locale="en-IN"
  timeZone="Asia/Kolkata"
  lose={["Unlimited projects", "Custom domains", "Priority support"]}
  keep={["All your data, read-only", "3 projects on Free"]}
  alternatives={ALTERNATIVES}
  onAlternative={(id) => setNote(id === "pause" ? "You chose to pause for 1 month." : "You chose to switch to Free.")}
  onConfirm={() => new Promise<void>((resolve) => setTimeout(resolve, 600))}
  onResume={() => new Promise<void>((resolve) => setTimeout(resolve, 400))}
  onKeep={() => setNote("You kept Pro. Nothing changed.")}
/>

What input mistakes does Cancel Readback catch?

  • Cancelling without knowing when access actually ends (date, time, zone and days left)
  • Unclear refunds, by stating the refund or that there is none
  • Dark-pattern retention: alternatives appear once, below a cancel button that stays put
  • Regret, with a resume action on the receipt

What props does Cancel Readback accept?

CancelReadback props
PropTypeDefault
plan* (required)

Plan name, e.g. "Pro".

string—
accessEndsAt* (required)

When paid access ends if they cancel now.

Date | number | string—
lose* (required)

What the user loses when access ends.

string[]—
keep* (required)

What the user keeps after cancelling.

string[]—
refund

Refund wording, e.g. "₹1,240 back to your UPI within 5–7 days". `null` means no refund.

string | nullnull
alternatives

Pause or downgrade options, offered once, below the cancel button.

CancelAlternative[][]
onAlternative

Called with the id of a pause or downgrade option the user picks.

(id: string) => void—
onConfirm* (required)

Cancels. Return a promise to show a pending state; a rejection keeps the form.

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

Undoes the cancellation while access is still active.

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

Called when the user decides to keep the plan.

() => void—
cancelled

Controlled cancelled state.

boolean—
defaultCancelled

Initial cancelled state when uncontrolled.

booleanfalse
onCancelledChange

Called when the plan is cancelled or resumed.

(cancelled: boolean) => void—
locale

BCP 47 locale for the end date.

string—
timeZone

IANA time zone for the end date. Defaults to the visitor's.

string—
title

Heading; receives the plan name.

(plan: string) => React.ReactNode(p) => `Cancel ${p}`
confirmLabel

Cancel button text; receives the plan and end date.

(plan: string, end: End) => string(p, end) => (end.endsNow ? `Cancel ${p} now` : `Cancel, k…
keepLabel

Keep-plan button text.

(plan: string) => string(p) => `Keep ${p}`
resumeLabel

Resume button text on the receipt.

string"Undo cancellation"
noRefundText

Shown when there is no refund.

(end: End) => string(end) => (end.endsNow ? "No refund." : `No refund: you've…
earlyText

Explains that access continues until the end date.

(plan: string, end: End) => string(p, end) => `Cancelling today doesn't cut your time short…
doneText

Receipt text after cancelling.

(plan: string, end: End) => string(p, end) => (end.endsNow ? `${p} is cancelled and has end…
alternativesLabel

Heading for pause and downgrade options.

string"Or, instead of cancelling"
hideLabel

Text for hiding the alternatives.

string"Hide"

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

How is Cancel Readback accessible?

  • Labelled by its title (aria-labelledby)
  • The receipt is announced with role="status"
  • Buttons set aria-busy while pending
  • Lost and kept items use icons plus text

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: Cancel and resume on the server and compute access end and refunds from billing records, not from what the screen showed.

  • Shows the access end, refund and items you pass; it does not compute them
  • Cancelling and resuming happen in your callbacks

What expensive mistakes does Cancel Readback stop?

Cancelled without knowing when access ends

Also known as

cancel subscription · unsubscribe · billing · pause plan · downgrade · refund · churn · manage plan

What dependencies does Cancel Readback require?

Cancel Readback facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameCancel Readback
Registry identifier@bollard/cancel-readback
Install commandnpx shadcn@latest add @bollard/cancel-readback
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 Cancel Readback

How does Cancel Readback protect destructive mutations?

Cancel Readback prevents cancelled without knowing when access ends. Enforces deliberate friction against Cancelling without knowing when access actually ends (date, time, zone and days left), Unclear refunds, by stating the refund or that there is none, Dark-pattern retention: alternatives appear once, below a cancel button that stays put, Regret, with a resume action on the receipt. Limitation: authorize cancel-readback mutations on the server.

How do I install cancel-readback with shadcn?

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

What props customize Cancel Readback?

Cancel Readback accepts `plan`, `accessEndsAt`, `lose`, `keep`, `refund`. Configures cancel subscription, unsubscribe, billing behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of cancel-readback?

Shows the access end, refund and items you pass; it does not compute them. Cancelling and resuming happen in your callbacks Server requirement: Cancel and resume on the server and compute access end and refunds from billing records, not from what the screen showed.

How does Cancel Readback meet accessibility guidelines?

Labelled by its title (aria-labelledby). The receipt is announced with role="status". Buttons set aria-busy while pending. Lost and kept items use icons plus text. Minimizes errors: cancel subscription confusion, dark pattern cancel.

Which components pair with Cancel Readback?