BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/billingsdk/proration-preview

Proration Preview

billingsdk/proration-preview
FreeBlock

Interactive component that shows billing adjustments when users change subscription plans, featuring cost breakdowns, credits, and prorated charges

Install it

npx shadcn@latest add https://billingsdk.com/r/proration-preview.json

Source

src/registry/billingsdk/proration-preview.tsxbillingsdk.com/r/proration-preview.json · first 6 KB
1"use client";
2
3import { motion } from "motion/react";
4import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
5import { Badge } from "@/components/ui/badge";
6import { Button } from "@/components/ui/button";
7import { Separator } from "@/components/ui/separator";
8import {
9 ArrowRight,
10 Calendar,
11 CreditCard,
12 Calculator,
13 Clock,
14} from "lucide-react";
15import { type Plan, type CurrentPlan } from "@/lib/billingsdk-config";
16import { cn } from "@/lib/utils";
17import { cva, type VariantProps } from "class-variance-authority";
18
19const prorationPreviewVariants = cva("w-full max-w-3xl mx-auto", {
20 variants: {
21 theme: {
22 minimal: "",
23 classic:
24 "relative overflow-hidden rounded-xl border border-border/50 bg-gradient-to-br from-card/50 to-muted/30 backdrop-blur-sm",
25 },
26 size: {
27 small: "text-sm",
28 medium: "text-base",
29 large: "text-lg",
30 },
31 },
32 defaultVariants: {
33 theme: "minimal",
34 size: "medium",
35 },
36});
37
38const cardVariants = cva("transition-all duration-300", {
39 variants: {
40 theme: {
41 minimal: "border border-border bg-card",
42 classic:
43 "border border-border/30 bg-gradient-to-br from-card/80 to-muted/20 backdrop-blur-sm shadow-md",
44 },
45 },
46 defaultVariants: {
47 theme: "minimal",
48 },
49});
50
51/**
52 * Props for `ProrationPreview`.
53 *
54 * Combines visual variants from `prorationPreviewVariants` with
55 * the billing context needed to compute proration math.
56 *
57 * - `currentPlan` and `newPlan` supply pricing and labels
58 * - `billingCycle` controls the target cycle for the new plan
59 * - `daysRemaining` and `effectiveDate` influence credit/charge math
60 * - `onConfirm`/`onCancel` wire user actions
61 */
62export interface ProrationPreviewProps extends VariantProps<
63 typeof prorationPreviewVariants
64> {
65 className?: string;
66 currentPlan: CurrentPlan;
67 newPlan: Plan;
68 billingCycle: "monthly" | "yearly";
69 daysRemaining?: number;
70 effectiveDate?: string;
71 onConfirm?: () => void;
72 onCancel?: () => void;
73 confirmText?: string;
74 cancelText?: string;
75}
76
77/**
78 * ProrationPreview
79 *
80 * Renders a detailed, accessible preview of billing changes when a user switches
81 * subscription plans. It calculates and displays credits for unused time,
82 * prorated charges for the new plan, and the resulting net amount, with clear
83 * visual hierarchy and responsive styles.
84 *
85 * Key UI sections:
86 * - From/To plan summary with upgrade/downgrade badges
87// … truncated

What it pulls in

npm packages

  • lucide-react
  • class-variance-authority
  • motion

Other registry items

  • button
  • card
  • badge
  • separator
  • tabs
  • utils

Files it writes

  • src/registry/billingsdk/proration-preview.tsx
  • src/registry/billingsdk/demo/proration-preview-demo.tsx
  • src/registry/lib/billingsdk-config.ts

Facts

Registry
billingsdk
Type
registry:block
Access
Free
Files written
3
Licence
the repository states none
In the index
at or before 2026-08-08
Last confirmed
today

Go to the source

billingsdk.com dodopayments/billingsdk on GitHub Raw registry item This item as JSON

More from billingsdk

All 35 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
All ComponentsallbillingsdkBlocksFreeno deps
Top BannerbannerbillingsdkBlocksFree2 deps · 2 files
Billing Screenbilling-screenbillingsdkBlocksFree2 deps · 2 files
Billing Settingsbilling-settingsbillingsdkBlocksFree2 deps · 2 files
Billing Settings 2billing-settings-2billingsdkBlocksFree1 dep · 2 files
Cancel Subscription Cardcancel-subscription-cardbillingsdkBlocksFree1 dep · 3 files
Cancel Subscription Dialogcancel-subscription-dialogbillingsdkBlocksFree1 dep · 3 files
Detailed Usage Tabledetailed-usage-tablebillingsdkBlocksFreeno deps · 2 files

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex