Billing Subscription Pause Modal
A confirmation dialog that lets a customer pause their subscription instead of canceling outright. It opens from a trigger button, presents a duration picker with a live resume-date readout and a short list of what changes while paused, then confirms into a success screen once the customer commits. Modeled on this category's existing cancel and upgrade dialogs, so it fits the same install pattern.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its dialog, button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-subscription-pause-modal.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing131.tsx instead.
Usage
The file also exports billing131Demo, 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 { Billing131, billing131Demo } from "@/components/blocks/billing/billing131"; export default function Page() { return <Billing131 {...billing131Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| triggerLabel | string | "Pause subscription" | Label on the button that opens the dialog. |
| planName | string | none | Plan name referenced throughout the dialog copy. |
| currentPeriodEnd | string | none | Date the current billing period ends, when the pause actually takes effect. |
| durations | PauseDuration[] | none | Selectable pause lengths, each with a precomputed resumesOn date. |
| defaultDurationId | string | durations[0].id | Which duration is selected when the dialog opens. |
| impactPoints | string[] | none | Short bullet list of what changes during the pause, shown below the resume-date readout. |
| confirmLabel | string | "Confirm pause" | Label on the confirm button in the selection step. |
| cancelLabel | string | "Never mind" | Label on the dismiss button in the selection step. |
| confirmedTitle | string | "Subscription paused" | Heading shown on the success step. |
| className | string | none | Extra classes for the trigger button. |
Types
interface PauseDuration { id: string; label: string; resumesOn: string; }
Behavior notes
- The dialog has two internal steps, select and confirmed, tracked in local state; confirming a duration moves from select to confirmed without closing the dialog.
- Selected duration is local state defaulting to defaultDurationId or the first entry in durations; picking a different radio option updates the resume-date readout immediately.
- Each duration carries its own precomputed resumesOn string rather than a raw date, so the component does no date arithmetic and stays free of timezone or locale bugs.
- Closing the dialog, by the backdrop, the close button, or Never mind, resets step and the selected duration back to their defaults after the close animation finishes, so reopening always starts clean.
- The confirm button is disabled if no duration is resolved, which only happens if an empty durations array is passed in.
Frequently asked questions
More Billing Blocks
View all →Billing Invoice List
Invoice history table with status badges, formatted amounts, and a per-row download link, built with shadcn/ui and Tailwind CSS.
Billing Failed Payment Alert
High-contrast failed-payment alert with a message, a retry button, and an optional update-payment-method button, built with shadcn/ui and Tailwind CSS.
Billing Credit Balance
Compact credit balance card with a large total, an optional purchased-versus-promotional breakdown, a low-balance notice, and a top-up button.
Billing Payment Methods
A saved payment method list for React and Next.js with brand icons, a default badge, near-expiry warnings, and remove/set-default actions per row.
Billing Add Card
A card entry form for React and Next.js with auto-formatted fields, internal brand detection, and per-field validation feedback built with shadcn/ui and Tailwind CSS.
Billing Coupon Code
An inline promo code input for React and Next.js with a simulated loading state, an applied summary showing the discount amount, and an invalid-code message.