InputNumber
Number with ± steppers and Intl format
For amounts, quantities and prices: values you count or add up. Something that is merely made of digits — a phone number, a postcode, a card number — is not a number; use InputMask or Input.
Basic
税込
format(anyIntl.NumberFormatoptions) applies while the field isn't focused; on focus you edit the plain number, with the locale's decimal mark (1,5inde-DE).stepcounts frommin, as in HTML:min=5 step=10gives 5, 15, 25. The value snaps to a step on blur.- Keys: ↑/↓ one step, Page Up/Down ten, Home/End to
min/maxwhen set. Screen readers hear the formatted value with prefix and suffix. namesubmits the plain number with the form (1980), not the formatted text (¥1,980).:buttons="false"when the steppers make no sense, like a large price.
Usage
ts
import { BlessInputNumber } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
id | string | — | |
name | string | — | submitted with the form as the plain number, not the formatted text |
min | number | — | |
max | number | — | |
step | number | 1 | |
buttons | boolean | true | ± buttons |
prefix | string | — | |
suffix | string | — | |
format | Intl.NumberFormatOptions | — | Intl.NumberFormat options used while not focused |
locale | string | — | |
size | "md" | "sm" | "lg" | "md" | |
disabled | boolean | — | |
invalid | boolean | — | |
label | string | — | |
modelValue | number | null | null |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: number | null] |