Numeric input with − / + buttons (press and hold to accelerate), bounds and step, arrow keys and mouse wheel, Intl formatting (currency, percent, unit) and a “scrub” label: drag horizontally to change the value, with optional pointer lock.
Bounds; the value is clamped and buttons disable at the limits.
step
number
1
Step (also sets the precision).
large-step
number
step × 10
Step with Shift, Page↑/Page↓.
format
decimal | currency | percent | unit
decimal
Intl.NumberFormat style (percent: 0.15 displays as “15%”).
currency
string
USD
ISO 4217 code for format=currency.
unit
string
Intl unit for format=unit (kilogram, centimeter, liter…).
decimals
number
Fixed number of displayed decimals.
locale
string
en-US
Formatting and input locale (both “,” and “.” are accepted). The value auto follows the page language (nearest lang); without the attribute, en-US unless the app registered the page language with setStrings() (core/i18n.js).
layout
split | stacked
split
− / + on either side, or chevrons stacked on the right.
wheel
boolean
The mouse wheel changes the value while the field has focus.
scrub
boolean
Dragging horizontally on the label changes the value (Shift ×10, Alt ×0.1).
pointer-lock
boolean
Locks the pointer while scrubbing (infinite drag + virtual cursor).
scrub-pixels
number
4
Pixels of movement per step.
placeholder
string
Text shown when empty.
required / disabled / readonly / invalid
boolean
Form states.
data-size
sm | lg
Height.
Properties
Name
Type
Description
value
number | null
Numeric value.
valueAsNumber
number
Value or NaN.
strings
Partial<Record<string, string>>
Overrides for the default text (en-US): decrease and increase (stepper button labels), valueMissing (required message). App-wide translations: setStrings() from core/i18n.js, under the key "number-field". Can be set before the element is defined.
Methods
Name
Description
stepUp(n) / stepDown(n)
Adds / removes n steps.
focus()
Focuses the input.
checkValidity() / reportValidity()
Native validation.
Events
Name
Description
mv-change
detail: { value, formatted } on every committed change (step, typing, scrub).
APG Spinbutton pattern: the input has role=spinbutton, aria-valuenow, aria-valuetext (formatted value, e.g. “$24.90”), aria-valuemin/max, and the name of the built-in or associated <label>. ↑/↓ (Shift ×10), Page↑/↓, Home/End (bounds), Enter commits, Escape cancels typing. The −/+ buttons are out of the tab order (tabindex=-1) and labeled “Decrease” / “Increase”. Scrubbing is a pointer shortcut, never the only way to change the value.