Skip to main content
The select custom element renders a <select> populated from a static option list. Use it for merchant-defined enumerated choices.

Factory

Example

Options

CustomSelectOption

Typed option lists

Pass options as const to narrow defaultValue to the union of supplied values:

Minimum two options

The SDK refuses to mount a <select> with fewer than two entries. Passing options: [] or options: [{...}] logs a console warning and returns a no-op handle. Every subsequent call on that handle is silently ignored.

Reserved value

The empty string '' is reserved for the placeholder slot. Any merchant-supplied options[].value === '' triggers a console warning and a no-op handle. Use placeholder when you need a “none” affordance.

Initial selection

The initial selected value resolves in this order at mount:
  1. defaultValue, when supplied and it matches one of options[].value.
  2. Otherwise, when placeholder is set, the placeholder slot renders selected and the emitted value on first interaction is null.
  3. Otherwise, options[0] is pre-selected and the emitted value on mount equals options[0].value.
A defaultValue that does not match any option logs a console warning and falls through to step 2 or 3.

required behavior

With required: true and no placeholder, the field never trips the empty check because a real selection is always present from mount. Pair required: true with placeholder to force shoppers to make an explicit choice.

Value

The emitted value is exactly the chosen option’s value string. Selecting the placeholder slot emits null. Submit forwards the same shape.

Inside Checkout

See also

Last modified on July 17, 2026