Factories
Shared options
Every custom element extends the same base:Value shapes
text, number, and select emit null while empty or mid-typing an unparseable value. checkbox always has a state.
Events
Custom elements support the same six core events as built-in elements:onReady, onChange, onSubmit, onError, onFocus, onBlur, plus onEscapeKeyPressed. Wallet-only events (onClick, onExit) are not emitted.
Validation
- Without
validate, the only built-in check is the synchronousrequiredempty check (unchecked-box oncheckbox). Format checks are intentionally not provided because custom elements collect arbitrary merchant-defined data. numberadds built-inminandmaxrange checks whenvalidateis not supplied.selectaccepts only values that match one ofoptions[].value.- Providing
validateskips every built-in check. The callback receives the current value (includingnullfor empty inputs) and owns the entire validity contract. Returnnullfor valid, or a non-empty string to surface aFieldErrorwithcode: 'custom'.
FieldError
field always equals the element’s name. Bucket errors by field to place them next to the matching input.
Imperative value getters
Every custom element handle exposes read-only getters for the current snapshot.text, select, and checkbox expose .value. number is different: .value returns the raw display string as the shopper sees it (or ''), and .numericValue returns the parsed number | null. Use numericValue whenever you need to compute or forward the numeric value.
textandselectreturnnullwhen empty.number.valuereturns''while empty;number.numericValuereturnsnull.checkboxalways returns aboolean.
Inside Checkout
Custom elements can be configured undercustomElements on overflow.checkout(). Each slot appears on the aggregated envelope as:
checkout.getCustomElement(name).
Inside Checkout, appearance is not allowed on custom slots. Style the whole Checkout as one cohesive unit; see Theming.
Duplicate names
Two elements with the samename on the same Overflow instance log a warning; the second one returns a no-op handle. Its mount, on, update, and submit calls are silently ignored.