BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/paddle/plan-change-preview

Plan change preview

paddle/plan-change-preview
FreeComponent

Compact plan change summary card with side-by-side plan comparison, proration breakdown, upgrade/downgrade badge, discount, scheduled change warning, and optional confirm/cancel actions. Decision-support view for plan change flows.

Install it

npx shadcn@latest add https://developer.paddle.com/r/plan-change-preview.json

Source

registry/new-york/blocks/plan-change-preview/components/plan-change-preview.tsxdeveloper.paddle.com/r/plan-change-preview.json · first 6 KB
1"use client"
2
3import * as React from "react"
4import { ArrowRight, AlertCircle } from "lucide-react"
5import {
6 Card,
7 CardContent,
8 CardDescription,
9 CardHeader,
10 CardTitle,
11} from "@/registry/new-york/ui/card"
12import { Badge } from "@/registry/new-york/ui/badge"
13import { Skeleton } from "@/registry/new-york/ui/skeleton"
14import { Separator } from "@/registry/new-york/ui/separator"
15import { Alert, AlertDescription } from "@/registry/new-york/ui/alert"
16import { cn } from "@/lib/utils"
17import type { PlanChangePreviewData } from "@/registry/new-york/blocks/paddle-helpers/lib/paddle-types"
18import {
19 formatMoney,
20 formatDate,
21 formatBillingCycle,
22 formatProrationMode,
23} from "@/registry/new-york/blocks/paddle-helpers/lib/paddle-format"
24
25/** Props for the `PlanChangePreview` component. */
26export type PlanChangePreviewProps = {
27 preview?: PlanChangePreviewData
28 /**
29 * Paddle proration billing mode passed to `PATCH /subscriptions/{id}/preview`.
30 * The component derives the billing row label and effective date from this value.
31 */
32 prorationBillingMode?:
33 | "prorated_immediately"
34 | "full_immediately"
35 | "prorated_next_billing_period"
36 | "full_next_billing_period"
37 | "do_not_bill"
38 className?: string
39}
40
41export function PlanChangePreview({
42 preview,
43 prorationBillingMode,
44 className,
45}: PlanChangePreviewProps) {
46 if (!preview) {
47 return <PlanChangePreviewSkeleton className={className} />
48 }
49
50 const {
51 currency,
52 currentPlan,
53 newPlan,
54 costImpact,
55 discount,
56 scheduledChange,
57 subscriptionStatus,
58 collectionMode,
59 } = preview
60 const isCharge = costImpact.resultDirection === "charge"
61 const isCredit = costImpact.resultDirection === "credit"
62 const isNeutral = costImpact.resultDirection === "none"
63 const isManual = collectionMode === "manual"
64 const isTrialing = subscriptionStatus === "trialing"
65
66 const changeType = isCharge ? "upgrade" : isCredit ? "downgrade" : "change"
67
68 const prorationLabel = prorationBillingMode
69 ? formatProrationMode(prorationBillingMode)
70 : undefined
71
72 const isImmediate =
73 prorationBillingMode?.includes("immediately") || prorationBillingMode === "do_not_bill"
74
75 function resolveEffectiveDate(): string | undefined {
76 if (prorationBillingMode) {
77 if (isImmediate) return "Immediately"
78 return costImpact.nextBillDate ? formatDate(costImpact.nextBillDate) : undefined
79 }
80 if (costImpact.immediateAmount !== undefined) return "Immediately"
81// … truncated

What it pulls in

npm packages

  • lucide-react

Other registry items

  • @paddle/paddle-helpers
  • card
  • badge
  • skeleton
  • separator
  • alert

Files it writes

  • registry/new-york/blocks/plan-change-preview/components/plan-change-preview.tsx
  • registry/new-york/blocks/plan-change-preview/components/paddle-plan-change-preview.tsx
  • registry/new-york/blocks/plan-change-preview/lib/plan-change-preview-utils.ts

Facts

Registry
paddle
Type
registry:component
Access
Free
Files written
3
Theme wiring
ships cssVars
Licence
Apache-2.0
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

developer.paddle.com PaddleHQ/paddle-ui on GitHub Raw registry item This item as JSON

More from paddle

All 14 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Billing interval togglebilling-interval-togglepaddleComponentsFreeno deps
Checkout summarycheckout-summarypaddleComponentsFreeno deps · 3 files
Plan change breakdownplan-change-breakdownpaddleComponentsFree1 dep · 3 files
Pricing cardspricing-cardspaddleComponentsFree1 dep · 2 files
Pricing select cardspricing-select-cardspaddleComponentsFree1 dep · 4 files
Subscription alertsubscription-alertpaddleComponentsFree1 dep · 3 files
Subscription payment cardsubscription-payment-cardpaddleComponentsFree1 dep · 3 files
Subscription status cardsubscription-status-cardpaddleComponentsFree1 dep · 3 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex