Inline checkout
paddle/inline-checkoutFreeBlock
Inline checkout block with order summary, Paddle payment frame, and real-time event updates. Supports reactive item changes, plan switching, and quantity updates.
Install it
npx shadcn@latest add https://developer.paddle.com/r/inline-checkout.jsonSource
1"use client"23import * as React from "react"4import { CheckoutSummary } from "@/registry/new-york/blocks/checkout-summary/components/checkout-summary"5import { useCheckout } from "@/registry/new-york/blocks/paddle-client/lib/hooks/use-checkout"6import { addPaddleEventListener } from "@/registry/new-york/blocks/paddle-client/lib/paddle-instance"7import { mapCheckoutEventsToSummary } from "@/registry/new-york/blocks/checkout-summary/lib/checkout-summary-utils"8import { cn } from "@/lib/utils"9import {10 CheckoutEventNames,11 type Environments,12 type CheckoutCustomer,13 type CheckoutEventsData,14 type PaddleEventData,15 type CheckoutOpenLineItem,16} from "@/registry/new-york/blocks/paddle-client/lib/paddle-sdk-types"17import type {18 CheckoutCompleteData,19 CheckoutSummaryData,20} from "@/registry/new-york/blocks/paddle-helpers/lib/paddle-types"2122const INLINE_CHECKOUT_FRAME_TARGET = "paddle-inline-checkout-frame"2324const SUMMARY_EVENT_NAMES = new Set([25 CheckoutEventNames.CHECKOUT_LOADED,26 CheckoutEventNames.CHECKOUT_UPDATED,27 CheckoutEventNames.CHECKOUT_ITEMS_UPDATED,28 CheckoutEventNames.CHECKOUT_CUSTOMER_CREATED,29 CheckoutEventNames.CHECKOUT_CUSTOMER_UPDATED,30 CheckoutEventNames.CHECKOUT_DISCOUNT_APPLIED,31 CheckoutEventNames.CHECKOUT_DISCOUNT_REMOVED,32])3334/** Props for the `InlineCheckout` component. */35export type InlineCheckoutProps = {36 clientToken: string37 environment?: Environments38 items: CheckoutOpenLineItem[]3940 variant?: "one-page" | "multi-page"41 theme?: "light" | "dark"42 locale?: string43 /** Must be an absolute URL (starting with `https://` or `http://`) */44 successUrl?: string45 /** Controls where the order summary appears relative to the checkout frame. Defaults to "start" (summary on the left). */46 summaryPosition?: "start" | "end" | "top" | "bottom"4748 customer?: CheckoutCustomer49 customerAuthToken?: string50 discountCode?: string51 discountId?: string52 customData?: Record<string, unknown>5354 policyUrl?: string55 policyLabel?: string5657 /** Called when the Paddle checkout completes successfully */58 onComplete?: (data: CheckoutCompleteData) => void59 /** Called for every Paddle.js event emitted during checkout */60 onEvent?: (event: PaddleEventData) => void61 /** Called when the Paddle checkout fails to initialize or encounters an error */62 onError?: (error: Error) => void6364 className?: string65}6667export function InlineCheckout({68 clientToken,69 environment = "production",70 items,71 variant = "one-page",72 theme,73 locale,74// … 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 | |
| Pricing displaypricing-display | paddle | Blocks | Free | no deps |
