Skip to main content
Upcoming. These docs cover unreleased development, ahead of any published release. Use the channel picker at the top of the sidebar for the docs of a published release.
Whop Elements are hosted, themeable UI components you embed in your own site. Each element renders in an isolated frame served from Whop’s CDN. You install a thin, fully typed package and the element code stays up to date on its own.

Install

Mount your first element

Prefer npm over the script tag? loadWhop() injects the same hosted script and resolves the global constructor:

Global configuration

Everything you pass at construction applies to every element group created from that instance (a handle’s own options can override per group):
Appearance
Visual customization for every element — theme (light/dark + palettes), variables (CSS custom properties), and classes (per-part style declarations). The color scheme is applied before an element’s first paint, so dark pages never flash light. See Appearance.
"en" | "es" | "zh" | "nl" | "pt" | "de" | "it" | "fr" | "ja" | "pl" | "tr"
Locale for element UI text — one of the app’s built locales; any other value falls back to the default locale. Defaults to "en".
"production" | "sandbox"
Which Whop API environment the elements talk to — "sandbox" targets the sandbox API (test data; no real money moves). Choosing an environment is the only way to change where the elements send what a buyer types, and both environments are Whop’s own. The sandbox environment is not yet generally available. Defaults to "production".
In React, the same object rides <WhopElements appearance={…} locale={…}>.

Next

  • Appearance: theming, CSS variables, and per-part restyling
  • Payments: Drives a payment collection surface against the Whop Payments API. Charge config is a plan id OR the inline currency/amount — a plan resolves client-side to the same shape, one path either way. Mount ONE of its faces — the payment element (the full method list), the fused card element, or the exploded card-fields unit — then payments.createConfirmationToken({ billingDetails }) is the ONE confirm verb for all of them: it tokenizes the selection and mints a confirmation token your server confirms with a secret key; the payment’s client_secret then drives any pending step via handleNextAction.
  • Checkout: Drives a full hosted checkout for one plan — price summary, promo codes, the currency the buyer pays in, and the whole payment collection surface (the payments elements, composed inside) — against the Whop checkout sessions API. Mount it with a plan and the element creates the checkout session itself; the session credential never leaves the element. Or resume a session you already hold by passing its session secret. The buyer pays inside the element; you get onCompleted with the payment id. A payment needing an off-site step (3DS, a bank page) is driven automatically — on whop.com the buyer is brought back into the restored checkout, and when you embed the element they return to the returnUrl you set. EVERY option here is CREATE-TIME: a checkout session is minted at mount from these values, so changing one later (update(), or new React props) refuses loudly instead of silently charging the booted order — mount a fresh checkout to change what is being bought.
  • Ads: An advertising account. Scope it to a company with accountId — the ad account underneath is assigned server-side and never surfaces here — then mount reporting for what the account spent and what came back, or campaign-creator to build a campaign.
  • Wallet: Drives an account’s money surfaces. deposit returns live funding rails; send moves money to a recipient or creates a public claim link; withdraw collects a payout request; balances holds two faces — the holdings list, and the balance block drawing value over a window; cards lists issued cards; and activity lists ledger movements. Every surface but deposit can use the viewer’s session when no token is provided.
  • Websites: An account’s websites: every site built on whop.app plus every domain the Whop Pixel reports, with traffic per domain. Mount websites and it lists them with visitors, page views, trend, and most-viewed pages. Reading stats is privileged, so it needs an accessToken — except inside Whop’s own app, where the viewer’s session carries the read.