Xzero UI
Pro library

Cancel flowPro

A cancellation flow that answers each reason with a tailored offer and a calm hold-to-cancel.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/cancel-flow
Live · keyboard ready

Use this in billing settings when someone cancels a subscription. Connect each offer's accept to your discount, pause or plan change API, the hold to your cancel endpoint, and the note to your feedback store; the preview simulates them.

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/cancel-flow

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { CancelFlow } from "@/components/xzero/blocks/cancel-flow/cancel-flow";

export default function CancelPage() {
  return (
    <main>
      <CancelFlow />
    </main>
  );
}

API reference

CancelFlow

A three step subscription cancellation (reason, tailored offer, confirm) that ends in a hold-to-cancel. Reasons, offers, price, resume dates and impacts are sample data in cancel-flow.tsx.

No props.

Keyboard interactions

KeysAction
Arrow keysMove between reason cards and select them (wraps around).
Home / EndSelect the first or last reason; on the pause offer, set the shortest or longest pause.
Up / Down, Left / RightOn the pause offer, change the pause length between one and three months.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Guidance for AI tools

Blocks are complete, self-contained screens with sample data. Replace the sample data and connect the callbacks described above. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components