The Overflow instance
You create oneOverflow instance per page and keep it. The instance owns your publishable key, page-wide options (locale, theme, validation debounce), and every element you create. Do not construct a new Overflow(...) to change options at runtime — call overflow.update({ ... }) on the existing instance instead.
live_pub_…for production.test_pub_…for staging or test.
overflow.destroy() when you are done to tear down the instance and every element it created.
Elements
An element is a self-contained payment UI component you mount into a host node on your page. You create one by calling a factory on yourOverflow instance.
- Checkout: a composite element that renders a full payment form. Use it as your primary integration.
- Payment methods:
card,bank,applePay,googlePay. Mount standalone or nest inside Checkout. - Address elements:
billingAddress,shippingAddress, with optional autocomplete. - Contact elements:
email,fullName,phone,companyName. - Custom elements:
text,number,select,checkboxfor arbitrary metadata. - Submit button: a themed submit CTA (
submitButton).
Options
Every element factory accepts an options object with a uniform shape:- Top-level keys control behavior. Examples:
splitModeonfullName,defaultCountryonphone,modeonbank,paymentMethodsoncheckout. fieldscarries per-input customization:label,placeholder,disabled,hidden, and so on.BaseElementOptionsare common to every element:disabled,readOnly,id,ariaLabel,locale,required,validate?. The cascade flows from the element to its fields; per-field overrides win.- Compound elements (Checkout) nest the standalone options shape under each per-method key. What you configure standalone works the same way inside Checkout.
Events
Every element emits six core events. Some elements emit more where it matters.
Wallets add
onClick (for pre-sheet gating) and onExit (when the shopper dismisses the sheet). Non-wallet, non-button elements add onEscapeKeyPressed.
Theming
Pass design tokens on theOverflow instance. Every mounted element inherits them.
complete vs value
Two concepts govern when a form is ready to submit:
valueis the current tokenized or typed data for an element. For payment methods it isnulluntil submission produces a token; for input elements it is the current shopper input.completeis a boolean that flipstruewhen the element passes validation. For a card element, that means every required field is filled and format-valid; for an email element, that means the value matches the email schema.
complete from onChange to gate your Pay button. Read value from onSubmit to forward to your server.
Standalone vs Checkout
You have two integration shapes:- Checkout renders shopper contact, addresses, and payment methods in one mount. One
onSubmitreturns the whole payload. Use this when you want a turnkey form. - Standalone mounts one element at a time. You gate your submit button on
onChange.completefor each element, forward each.onSubmitpayload yourself, and control the layout.
Next steps
Quickstart
Mount your first element.
Checkout
Start with the composite element.
Elements
Browse every element.
Events
Full event reference.