Cancellation flow
A short flow that asks why, offers alternatives and confirms a cancellation.
When to use
- Letting customers cancel without contacting support.
- You want to offer a pause or a lower plan first.
When not to use
- You need to remove data immediately; confirm separately.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/cancellation-flow
Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
CancellationFlow
8 props
PropTypeDefaultDescription
planName *string—
endsOn *string—When access ends, as text.
reasons *readonly CancelReason[]—
consequences *readonly string[]—What the customer loses or keeps.
onOffer((offerId: string, reason: string) => void)—
onCancel *(reason: string, details: string) => void | Promise<void>—
onUndo(() => void)—
classNamestring—
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It exposes status semantics, with aria-hidden kept in step with state. Changes that matter are announced through a live region.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/cancellation-flow.mdThe index of every part is at /llms.txt.
More in Billing
Billing overviewThe current plan, payment method, next charge and recent invoices in one view.Confirm morphA destructive action that morphs into its own confirmation. The question drains a timer along its foot and the undo drains a ring; both pause while you are inside, and focus stays with the control as it changes.Usage billingThis month's invoice built from base fee and metered lines, with tax.