Skip to main content
Custom elements let you collect arbitrary merchant-defined data (gift messages, quantities, opt-ins, etc.) inside the SDK’s event, validation, and theming pipeline. Each type is a real OverflowElement you can mount standalone or configure under customElements inside Checkout.

Elements

Shared options

Every custom element extends the same base:

name

Uniquely identifies the element on the Overflow instance. Used as:
  • The key inside the Checkout value.customElements[name] envelope.
  • The field string on every emitted FieldError.
  • The registry key for checkout.getCustomElement(name).
Names must be unique per Overflow instance. Duplicates log a warning and return a no-op handle.

label

Required. Renders as the input’s <label> and interpolates into default error messages (for example, "<label> is required").

defaultValue

Seeds the DOM on mount. No onChange fires from the seed; the value is visible via element.value before any interaction.

autocomplete

Forwarded to the input’s autocomplete DOM attribute. Accepts the full HTML autofill token grammar ('off', 'organization-title', 'shipping street-address', etc.).

Validation precedence

When you supply validate?, the built-in required check is skipped and your callback owns validity. Without validate?, the only built-in check is required (empty input on text/number/select, unchecked box on checkbox); custom elements do not run format checks because the data is merchant-defined.

Emit shape

  • text, number, select: value is the current typed value or null while empty, unparseable, or unselected.
  • checkbox: value is always a boolean; there is no null state.

Standalone example

Inside Checkout

Access an individual slot with checkout.getCustomElement(name). See Custom elements section.

Element pages

Text

Free-form text input.

Number

Numeric input with mode, precision, min, max, and adornments.

Select

Dropdown with typed options.

Checkbox

Boolean opt-in or hard consent.
See the Custom reference for the consolidated option table.
Last modified on July 17, 2026