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
| Attribute | Description | Type | Default |
|---|---|---|---|
disabled | Disabled | boolean | — |
label | Accessible name (aria-label source; falls back to built-in "数字输入框" when unset) | — | — |
max | Range, out-of-range values are clamped automatically | string | — |
min | Range, out-of-range values are clamped automatically | string | — |
precision | Number of decimal places | string | — |
step | Step | string | 1 |
value | Current value (controlled) | string | — |
Events
| Event | Description |
|---|---|
oas-change | Change on step or blur, detail: { value } (number) |