Skip to content

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.

PropTypeDefaultDescription
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"`.
currentPeriodEndDate—End of the current billing period. Defaults to a fixed date.
lastPaymentAmountnumber—Shown in the "Last payment" hint when present.
proratedAmountnumber—Shown in the "Pro-rated amount" hint when present.
onConfirm*(payload: CancelSubscriptionPayload) => void—Undocumented — add TSDoc to the prop in the library.
nowDateDEFAULT_CANCELLATION_NOWReference "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.
initialTimingCancellationTiming"end_of_period"Preselects a timing. `"custom"` reveals the date picker.
initialCustomDateDate—Preselects a custom date. Only meaningful with `initialTiming: "custom"`.
initialRefundSubscriptionRefundOption"none"Undocumented — add TSDoc to the prop in the library.
defaultDatePickerOpenbooleanfalseOpens the desktop date popover on mount so it is a static story.
isMobileboolean—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.