Checkout summary
paddle/checkout-summaryFreeComponent
Order summary for inline checkout: line items, totals, recurring/trial info, and refund policy link. Compliance-ready display for Paddle inline checkout.
Install it
npx shadcn@latest add https://developer.paddle.com/r/checkout-summary.jsonSource
1"use client"23import * as React from "react"4import { Card, CardContent, CardHeader, CardTitle } from "@/registry/new-york/ui/card"5import { Separator } from "@/registry/new-york/ui/separator"6import { Skeleton } from "@/registry/new-york/ui/skeleton"7import { cn } from "@/lib/utils"8import type { CheckoutSummaryData } from "@/registry/new-york/blocks/paddle-helpers/lib/paddle-types"9import {10 formatMoney,11 formatBillingCycle,12} from "@/registry/new-york/blocks/paddle-helpers/lib/paddle-format"1314/** Props for the `CheckoutSummary` component. */15export type CheckoutSummaryProps = {16 summary?: CheckoutSummaryData17 policyUrl?: string18 policyLabel?: string19 className?: string20}2122export function CheckoutSummary({23 summary,24 policyUrl,25 policyLabel = "Refund policy",26 className,27}: CheckoutSummaryProps) {28 if (!summary) {29 return <CheckoutSummarySkeleton className={className} />30 }3132 const {33 items,34 subtotal,35 tax,36 total,37 discount,38 currency,39 recurringTotal,40 recurringInterval,41 recurringFrequency,42 trialPeriod,43 } = summary4445 const recurringInfo =46 recurringTotal !== undefined && recurringInterval47 ? (() => {48 const cycleLabel = formatBillingCycle({49 frequency: recurringFrequency ?? 1,50 interval: recurringInterval,51 })52 const recurringAmount = formatMoney(recurringTotal, currency)53 return cycleLabel ? `${recurringAmount} / ${cycleLabel}` : recurringAmount54 })()55 : undefined5657 return (58 <Card className={cn("gap-4", className)}>59 <CardHeader>60 <CardTitle className="text-base font-semibold">Order summary</CardTitle>61 </CardHeader>6263 <CardContent className="flex flex-col gap-4">64 <ul className="space-y-3">65 {items.map((item, index) => (66 <li key={index} className="flex items-start justify-between gap-4 text-sm">67 <div className="min-w-0 flex-1">68 <span className="font-medium">{item.name}</span>69 {item.priceName && (70 <span className="text-muted-foreground"> — {item.priceName}</span>71 )}72 {item.quantity > 1 && (73 <span className="text-muted-foreground"> × {item.quantity}</span>74 )}75 </div>76 <span className="shrink-0 tabular-nums">{formatMoney(item.lineTotal, currency)}</span>77 </li>78 ))}79 </ul>8081// … truncated
What it pulls in
Other registry items
Files it writes
More from paddle
All 14 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Billing interval togglebilling-interval-toggle | paddle | Components | Free | no deps | |
| Plan change breakdownplan-change-breakdown | paddle | Components | Free | 1 dep · 3 files | |
| Plan change previewplan-change-preview | paddle | Components | Free | 1 dep · 3 files | |
| Pricing cardspricing-cards | paddle | Components | Free | 1 dep · 2 files | |
| Pricing select cardspricing-select-cards | paddle | Components | Free | 1 dep · 4 files | |
| Subscription alertsubscription-alert | paddle | Components | Free | 1 dep · 3 files | |
| Subscription payment cardsubscription-payment-card | paddle | Components | Free | 1 dep · 3 files | |
| Subscription status cardsubscription-status-card | paddle | Components | Free | 1 dep · 3 files |
