Skip to main content
The number custom element renders a numeric input with optional prefix/suffix adornments, decimal precision, and range checks. Use it for merchant-defined quantities, monetary amounts, or rates.

Factory

Example

Options

NumberAdornment

  • 'inset' overlays the adornment inside the input chrome. Best for short symbols ($, %).
  • 'tab' renders the adornment as a separate chip glued to one edge of the input. Best for short text labels (USD, kg).
Each side chooses its style independently. Adornments are non-interactive; clicks anywhere in the field focus the input.

Mode, precision, and range

  • mode: 'integer' allows digits and a leading - only. mode: 'decimal' also allows a single ..
  • precision caps decimal places while typing. Values past the cap are blocked; a defaultValue beyond the cap is truncated at mount.
  • min and max run at submit time unless validate is set.

Value

null while the input is empty or mid-typing an incomplete number (for example '-' or '1.').

Inside Checkout

See also

Last modified on July 29, 2026