Shared
Cancel subscription modal
CancelSubscriptionModal — exported from the library at `src/components/subscriptions/CancelSubscriptionModal.tsx`. Awaiting a written description.
Available
Ports as-is
Examples
Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.
Cancel subscription modal
Rendered live from Storybook
Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.
Props
The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.
| Prop | Type | Default | Description |
|---|---|---|---|
open* | boolean | — | Undocumented — add TSDoc to the prop in the library. |
onOpenChange* | (open: boolean) => void | — | Undocumented — add TSDoc to the prop in the library. |
subscriptionLabel* | string | — | What is being cancelled, e.g. `"Backstage Pass — monthly"`. |
currentPeriodEnd | Date | — | End of the current billing period. Defaults to a fixed date. |
lastPaymentAmount | number | — | Shown in the "Last payment" hint when present. |
proratedAmount | number | — | Shown in the "Pro-rated amount" hint when present. |
onConfirm* | (payload: CancelSubscriptionPayload) => void | — | Undocumented — add TSDoc to the prop in the library. |
now | Date | DEFAULT_CANCELLATION_NOW | Reference "now". Used for the immediate-cancellation effective date and to floor the calendar's disabled range. Defaults to `DEFAULT_CANCELLATION_NOW` so nothing here reads the system clock. |
initialTiming | CancellationTiming | "end_of_period" | Preselects a timing. `"custom"` reveals the date picker. |
initialCustomDate | Date | — | Preselects a custom date. Only meaningful with `initialTiming: "custom"`. |
initialRefund | SubscriptionRefundOption | "none" | Undocumented — add TSDoc to the prop in the library. |
defaultDatePickerOpen | boolean | false | Opens the desktop date popover on mount so it is a static story. |
isMobile | boolean | — | Overrides the measured viewport. `undefined` uses the live viewport; pass `true`/`false` to force the drawer or the dialog branch. |
Reference
Transcribed from the component audit. If this disagrees with the source, the source is right.
- Source
src/components/subscriptions/CancelSubscriptionModal.tsx- Portability
- Copies across unchanged — only the utils import path moves.