Skip to main content
This page documents @whop/elements@1.0.0-beta.0 and @whop/elements-react@1.0.0-beta.0.
Pre-release, not yet part of a stable release.

Playground

Assemble the elements with example data. Drive the controls, add and arrange elements, and watch events fire live:

Options

Pass these to whop.checkout.create({ … }), or as props on <Checkout> in React.
string
Existing plan ID, prefixed plan_. The element creates a checkout session for it, and the plan defines the price; nothing about amounts can be asserted client-side. Every checkout names one — omitting it refuses loudly at mount. Set at create only: the session is minted from it, and changing it later refuses.
number
How many units to purchase. Plans that disallow multiples refuse values above 1. Set at create only: the session is minted with it, and changing it later refuses. @default 1
string
A promo code to apply before the buyer ever sees the price — the discount is on the first quote, and the buyer can still change or remove it. Pass the code a marketing link carried: a code that has expired or was never valid opens the checkout at full price with the reason on the promo row, never a checkout that will not open. Set at create only.
string
The affiliate this checkout is attributed to. Set at create only.
CheckoutAttributionInput
Where this sale came from, for the account’s reporting: the campaign parameters of the link the buyer arrived on (utmSource, utmMedium, utmCampaign, utmTerm, utmContent, a Whop trackingLinkId, a funnelId, and your own source). Everything here is recorded against the order and is never shown to the buyer. Set at create only.
Record<string, string>
Your own key/value pairs to record against the order and read back on the payment — order IDs, cart IDs, or anything you reconcile against. Up to 40 string pairs. Set at create only.
string
Where the buyer lands after an off-site payment step. Https-only (http for localhost). Set at create only.
Appearance
Visual customization for this group’s elements. Overrides the global WhopElements({ appearance }). Change it live with update({ appearance }).
WhopElementsLocale
Locale for this group’s element UI text. Set it to one of the app’s built locales to override the global configuration. Any other value falls back to the default locale.

Events

Pass callbacks in the create options or React props.

onLoadingChange

Runs when the grouped loading state changes. The value is true while any mounted element is still loading. Signature: ((loading: boolean) => void)

Methods

Call these on the Checkout handle from whop.checkout.create({ … }) or useCheckout().

update

Merges new handle options into every mounted element. In React, change the namespace props instead. Signature: (options: Partial<CheckoutOptions>) => void

Types

Named types used throughout this page.

CheckoutAttributionInput

Checkout attribution recorded with the session. The element maps these fields to POST /api/v1/checkout_sessions; empty values are omitted, and country is resolved by the API.

utmSource

Signature: string | undefined

utmMedium

Signature: string | undefined

utmCampaign

Signature: string | undefined

utmTerm

Signature: string | undefined

utmContent

Signature: string | undefined

trackingLinkId

Signature: string | undefined

funnelId

Signature: string | undefined

source

Signature: string | undefined

Elements

The elements this group mounts. Each has its own page: Alternatives. Mount one at a time. Destroy it before mounting another:

CheckoutElement

The full checkout surface — order summary with the live quote, promo code entry, the currency the buyer pays in, everything this checkout has to collect from the buyer, the composed payment methods surface, and the pay flow. What it collects is whatever the account owner set up (email, their own questions, a phone number, a shipping address for physical goods, an explicit agreement to their terms), rendered together on one screen in the order they chose — so an account owner who starts asking for something new needs no change here. Renders the whole purchase; the checkout controller owns the session and the credential. After a payment that needs an off-site step, this same surface renders the outcome the server reports when the buyer comes back.

Flow surfaces

These internal elements open automatically during guided flows. They aren’t part of the consumer API, so you don’t mount or configure them.
  • CheckoutDetailsElement (checkoutDetails): The order-details sheet a narrow checkout opens for the promo code, currency, and totals.