Skip to main content
Complete reference for the four custom element types and the options they share.

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 synchronous required empty check (unchecked-box on checkbox). Format checks are intentionally not provided because custom elements collect arbitrary merchant-defined data.
  • number adds built-in min and max range checks when validate is not supplied.
  • select accepts only values that match one of options[].value.
  • Providing validate skips every built-in check. The callback receives the current value (including null for empty inputs) and owns the entire validity contract. Return null for valid, or a non-empty string to surface a FieldError with code: '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.
  • text and select return null when empty.
  • number.value returns '' while empty; number.numericValue returns null.
  • checkbox always returns a boolean.

Inside Checkout

Custom elements can be configured under customElements on overflow.checkout(). Each slot appears on the aggregated envelope as:
Subscribe to a single slot’s events with 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 same name 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.

See also

Last modified on July 29, 2026