Pricing display
paddle/pricing-displayFreeBlock
Pricing section with localized prices, billing interval toggle, and built-in overlay checkout. Supports current-plan highlighting and plan change selection flows via currentPriceIds and selectedPriceId props.
Install it
npx shadcn@latest add https://developer.paddle.com/r/pricing-display.jsonSource
1"use client"23import * as React from "react"4import { PricingTierCard } from "@/registry/new-york/blocks/pricing-cards/components/pricing-tier-card"5import { PricingTierCardGroup } from "@/registry/new-york/blocks/pricing-cards/components/pricing-tier-card-group"6import { usePaddlePrices } from "@/registry/new-york/blocks/paddle-client/lib/hooks/use-paddle-prices"7import {8 getOrCreatePaddle,9 addPaddleEventListener,10} from "@/registry/new-york/blocks/paddle-client/lib/paddle-instance"11import { BillingIntervalToggle } from "@/registry/new-york/blocks/billing-interval-toggle/components/billing-interval-toggle"12import { cn } from "@/lib/utils"13import { formatIntervalLabel } from "@/registry/new-york/blocks/paddle-helpers/lib/paddle-format"14import type {15 Environments,16 CheckoutEventsData,17 PaddleEventData,18 TimePeriod,19} from "@/registry/new-york/blocks/paddle-client/lib/paddle-sdk-types"20import type { CheckoutCompleteData } from "@/registry/new-york/blocks/paddle-helpers/lib/paddle-types"2122// Local alias for the interval string union from Paddle's TimePeriod.23// Uses the SDK's source of truth directly rather than a duplicated type.24type Interval = TimePeriod["interval"]2526/** Plan configuration for the `PricingDisplay` component. */27export type PricingDisplayPlan = {28 priceId?: string | Partial<Record<Interval, string>>29 name: string30 description?: string31 features?: string[]32 badge?: string33 badgePosition?: "left" | "center" | "right"34 icon?: React.ReactNode35 ctaLabel?: string36 onSelect?: () => void37}3839/** Props for the `PricingDisplay` component. */40export type PricingDisplayProps = {41 plans: PricingDisplayPlan[]42 clientToken: string43 environment?: Environments44 countryCode?: string45 discountId?: string46 showOriginalPrice?: boolean47 currentPriceIds?: string[]48 selectedPriceId?: string49 onPlanSelect?: (priceId: string) => void50 onCheckoutComplete?: (data: CheckoutCompleteData) => void51 className?: string52}5354const INTERVAL_ORDER: Interval[] = ["day", "week", "month", "year"]5556function getAllPriceIds(plans: PricingDisplayPlan[]): string[] {57 return plans.flatMap((plan) => {58 if (!plan.priceId) return []59 if (typeof plan.priceId === "string") return [plan.priceId]60 return Object.values(plan.priceId).filter(Boolean) as string[]61 })62}6364function getIntervals(plans: PricingDisplayPlan[]): Interval[] {65 const multiIntervalPlans = plans.filter(66 (p) => p.priceId !== undefined && typeof p.priceId !== "string"67 )68// … truncated
What it pulls in
Other registry items
Files it writes
More from paddle
All 14 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Express checkoutexpress-checkout | paddle | Blocks | Free | 1 dep · 3 files | |
| Inline checkoutinline-checkout | paddle | Blocks | Free | no deps |
