Provides state management for a number field component. Number fields allow users to enter a number,
and increment or decrement the value using stepper buttons.
Validates a user input string according to the current locale and format options.
Values can be partially entered, and may be valid even if they cannot currently be parsed to a number.
Can be used to implement validation as a user types.
Commits the current input value. The value is parsed to a number, clamped according
to the minimum and maximum values of the field, and snapped to the nearest step value.
This will fire the onChange prop with the new value, and if uncontrolled, update the numberValue.
Typically this is called when the field is blurred.
increment(): void
Increments the current input value to the next step boundary, and fires onChange.
decrement(): void
Decrements the current input value to the next step boundary, and fires onChange.
incrementToMax(): void
Sets the current value to the maxValue if any, and fires onChange.
decrementToMin(): void
Sets the current value to the minValue if any, and fires onChange.
Whether user input is required on the input before form submission.
Often paired with the necessityIndicator prop to add a visual indicator to the input.
Validates a user input string according to the current locale and format options.
Values can be partially entered, and may be valid even if they cannot currently be parsed to a number.
Can be used to implement validation as a user types.
Commits the current input value. The value is parsed to a number, clamped according
to the minimum and maximum values of the field, and snapped to the nearest step value.
This will fire the onChange prop with the new value, and if uncontrolled, update the numberValue.
Typically this is called when the field is blurred.
increment(): void
Increments the current input value to the next step boundary, and fires onChange.
decrement(): void
Decrements the current input value to the next step boundary, and fires onChange.
incrementToMax(): void
Sets the current value to the maxValue if any, and fires onChange.
decrementToMin(): void
Sets the current value to the minValue if any, and fires onChange.