Cancel & Downgrade

Dates first, the button in plain sight, and typing only for deleting now.

PROGet Cancel & Downgrade and 168 other Pro components with pro lifetime — Get Pro

Category
Billing
Access
Pro
Source
423 lines · one file

The decision inside it

No maze, one hard confirmation

Cancel is a visible button, not a link hidden under three retention screens. The only thing that asks for the workspace name is deleting everything today, because that is the only part that cannot be undone.

When to use it

Use Cancel & Downgrade for the cancel flow: what happens and when (read-only from, deleted on), an optional pause instead, a reason, and keep or cancel. Export of data comes first when you pass onExport.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Cancel & Downgrade for this.
Install it: npx shadcn@latest add @liro/cancel-subscription
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/cancel-subscription.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

components/cancel.tsx
import { CancelSubscription } from "@/components/ui/cancel-subscription";

export function Cancel({ cancel, keep }: { cancel: () => Promise<void>; keep: () => void }) {
  return (
    <CancelSubscription
      planName="Team"
      endsOn="14 Nov"
      deletesOn="14 Dec"
      workspaceName="Madgixs"
      reasons={["Too expensive", "Missing a feature", "Switching tools"]}
      onCancel={cancel}
      onKeep={keep}
    />
  );
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
planNamestring Yes–
endsOnstring YesThe last day of the paid period. Everything works until then.
deletesOnstring NoWhen the data is deleted after the period ends. Omit if it never is.
readOnlyMeansstring NoWhat read-only means for this product, in a sentence.
workspaceNamestring NoRequired to delete now: the name the customer types to confirm.
pause{ label: string; detail: string; onPause: () => void } NoOffer a pause. Omit on plans that cannot be paused.
reasonsstring[] NoReasons to offer. Optional for the customer, always.
onCancel(opts: { reason?: string; deleteNow: boolean }) => void No–
onKeep() => void No–
onResume() => void No–
onExport() => void No–
lookLook NoLayered sets the form on a card in a tray, the title above and the buttons in the strip below. Flat is one card.

Dependencies

npm packages

clsxframer-motionlucide-reacttailwind-merge

Liro foundations, installed alongside it

liro-theme

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances