Skip to content

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 (any Intl.NumberFormat options) applies while the field isn't focused; on focus you edit the plain number, with the locale's decimal mark (1,5 in de-DE).
  • step counts from min, as in HTML: min=5 step=10 gives 5, 15, 25. The value snaps to a step on blur.
  • Keys: ↑/↓ one step, Page Up/Down ten, Home/End to min/max when set. Screen readers hear the formatted value with prefix and suffix.
  • name submits 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

NameTypeDefaultDescription
idstring—
namestring—submitted with the form as the plain number, not the formatted text
minnumber—
maxnumber—
stepnumber1
buttonsbooleantrue± buttons
prefixstring—
suffixstring—
formatIntl.NumberFormatOptions—Intl.NumberFormat options used while not focused
localestring—
size"md" | "sm" | "lg""md"
disabledboolean—
invalidboolean—
labelstring—
modelValuenumber | nullnull

Events

NamePayloadDescription
update:modelValue[value: number | null]

Released under the MIT License. Character names and artwork belong to their owners.