Skip to content

InputNumber

An enhanced native <input type="number"> with stepper buttons and range constraints.

Basic Usage

Basic usage

Range & Step

min / max / step

Values beyond min / max are clamped; the corresponding stepper button is automatically disabled when a boundary is reached.

Precision

precision

precision controls the number of decimal places for stepping and clamping.

Disabled

Disabled

Accessible Name (label)

label (accessible name)

label serves as the accessible name (aria-label) for the input: once set, screen readers announce it; when unset, it falls back to the built-in text "数字输入框" (InputNumber has no placeholder fallback chain). The stepper buttons "增加 / 减少" also use built-in text for their accessible names.

Events

Change events

Listen to oas-change (fires on stepping or blur, detail: { value }):

API

Attributes

AttributeDescriptionTypeDefault
disabledDisabledboolean
labelAccessible name (aria-label source; falls back to built-in "数字输入框" when unset)
maxRange, out-of-range values are clamped automaticallystring
minRange, out-of-range values are clamped automaticallystring
precisionNumber of decimal placesstring
stepStepstring1
valueCurrent value (controlled)string

Events

EventDescription
oas-changeChange on step or blur, detail: { value } (number)