Elements

Reference

Number Input

NumberInput, dressed in the paper-and-ink system: the stepper rides inside the field as one seal split by a hairline, numbers set in tabular figures. The parts — Root, Label, Control, Input, ValueText, IncrementTrigger, DecrementTrigger, Scrubber.

Root · Label · Input · Control · ValueText · IncrementTrigger · DecrementTrigger · Scrubber

#Control

A styled part — no props of its own; it takes the anatomy's shared styling.

#DecrementTrigger

A styled part — no props of its own; it takes the anatomy's shared styling.

#IncrementTrigger

A styled part — no props of its own; it takes the anatomy's shared styling.

#Input

A styled part — no props of its own; it takes the anatomy's shared styling.

#Label

A styled part — no props of its own; it takes the anatomy's shared styling.

#Root

PropTypeDefaultDescription
sizeString as PropType<"sm" | "md" | "lg">"md"One rung of the control-height ladder for the field and its stepper.
allowMouseWheelbooleanWhether to allow mouse wheel to change the value
allowOverflowbooleantrueWhether to allow the value overflow the min/max range
clampValueOnBlurbooleantrueWhether to clamp the value when the input loses focus (blur)
defaultValuestringThe initial value of the input when rendered. Use when you don't need to control the value of the input.
disabledbooleanWhether the number input is disabled.
focusInputOnChangebooleantrueWhether to focus input when the value changes
formstringThe associate form of the input element.
formatOptionsIntl.NumberFormatOptionsThe options to pass to the Intl.NumberFormat constructor
idstringThe unique identifier of the machine.
idsPartial<{ root: string; label: string; input: string; incrementTrigger: string; decrementTrigger: string; scrubber: string; }>The ids of the elements in the number input. Useful for composition.
inputMode'text' | 'tel' | 'numeric' | 'decimal'"decimal"Hints at the type of data that might be entered by the user. It also determines the type of keyboard shown to the user on mobile devices
invalidbooleanWhether the number input value is invalid.
largeStepnumber10 * stepThe amount to increment or decrement the value by when the shift key is held
localestring"en-US"The current locale. Based on the BCP 47 definition.
maxnumberNumber.MAX_SAFE_INTEGERThe maximum value of the number input
minnumberNumber.MIN_SAFE_INTEGERThe minimum value of the number input
modelValuestringThe v-model value of the number input
namestringThe name attribute of the number input. Useful for form submission.
patternstring"[0-9]*(.[0-9]+)?"The pattern used to check the element's value against
readOnlybooleanWhether the number input is readonly
requiredbooleanWhether the number input is required
smallStepnumberstep / 10The amount to increment or decrement the value by when the alt key is held
spinOnPressbooleantrueWhether to spin the value when the increment/decrement button is pressed
stepnumber1The amount to increment or decrement the value by
translationsnumberInput.IntlTranslationsSpecifies the localized strings that identifies the accessibility elements and their states
EventPayload
focusChangedetails: FocusChangeDetails
valueChangedetails: ValueChangeDetails
update:modelValuevalue: string
valueInvaliddetails: ValueInvalidDetails

#Scrubber

A styled part — no props of its own; it takes the anatomy's shared styling.

#ValueText

A styled part — no props of its own; it takes the anatomy's shared styling.