Staaarter

Billing Cancel Subscription

A cancellation flow opened from a trigger button, with a clear warning about what changes, a single-select reason survey, and an optional feedback field. Confirming swaps the dialog to a confirmation step showing when access actually ends, instead of just closing. Keeps everything in local component state, no callback props required to demo the flow.

By Staaarter Team
Billing
Updated May 24, 2026
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its dialog, button, textarea, label dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/billing-cancel-subscription.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing8.tsx instead.

Usage

The file also exports billing8Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Billing8, billing8Demo } from "@/components/blocks/billing/billing8";

export default function Page() {
  return <Billing8 {...billing8Demo} />;
}

Props

PropTypeDefaultDescription
triggerLabelstring"Cancel subscription"Label for the button that opens the dialog.
planNamestringnonePlan name referenced in the warning and confirmation copy.
renewalDatestringnoneDate access ends, used in the impact warning and confirmation message.
impactPointsstring[]noneBullet points listing what changes after cancellation.
reasonsCancelReason[]noneSelectable cancellation reasons, rendered as a single-select chip group.
keepLabelstring"Keep my plan"Label for the primary button that closes the dialog without canceling.
confirmLabelstring"Confirm cancellation"Label for the destructive confirm button, disabled until a reason is picked.
confirmedTitlestring"Subscription canceled"Title shown on the confirmation step.
confirmedMessagestringauto-generated from planName and renewalDateBody copy for the confirmation step. Falls back to a generated sentence if omitted.
classNamestringnoneExtra classes for the trigger button.

Types

interface CancelReason {
  id: string;
  label: string;
}

Behavior notes

  • Dialog open state, the selected reason, and the optional feedback text are all held in local component state, nothing is passed in as a callback prop.
  • Confirm cancellation stays disabled until a reason chip is selected.
  • Confirming swaps the dialog body to a confirmation step instead of closing immediately, so the user sees exactly when their access ends.
  • Closing the dialog, whether via Keep my plan, Done, the overlay, or Escape, resets the reason, feedback, and step after the close animation finishes, so reopening always starts from the review step.

Frequently asked questions