A numeric input with increment and decrement buttons.
defaultValue | number | – | The uncontrolled value of the field when it's initially rendered. To render a controlled number field, use the |
disabled | boolean | false | Whether the component should ignore user interaction. |
form | string | – | Identifies the form that owns the hidden input. Useful when the number field is rendered outside the form. |
format | NumberFormatOptions | – | Options to format the input value. |
id | string | – | The id of the input element. |
inputRef | Ref<HTMLInputElement> | – | A ref to access the hidden input element. |
largeStep | number | 10 | The large step value of the input element when incrementing while the shift key is held. Snaps to multiples of this value when |
locale | LocalesArgument | – | The locale of the input element. Defaults to the user's runtime locale. |
max | number | – | The maximum value of the input element. |
min | number | – | The minimum value of the input element. |
name | string | – | Identifies the field when a form is submitted. |
onValueChange | ((value: number | null, eventDetails: NumberFieldRootChangeEventDetails) => void) | – | Callback fired when the number value changes. The
|
onValueCommitted | ((value: number | null, eventDetails: NumberFieldRootCommitEventDetails) => void) | – | Callback function that is fired when the value is committed. It runs later than
It runs simultaneously with **Warning**: This is a generic event not a change event. |
readOnly | boolean | false | Whether the user should be unable to change the field value. |
required | boolean | false | Whether the user must enter a value before submitting a form. |
size | "lg"|"sm"|"default" | default | The size of the component. |
smallStep | number | 0.1 | The small step value of the input element when incrementing while the alt key is held. Snaps to multiples of this value when |
snapOnStep | boolean | false | Whether the value should snap to the nearest step when incrementing or decrementing. |
step | number|"any" | 1 | Amount to increment and decrement with the buttons and arrow keys, or to scrub with pointer movement in the scrub area. To always enable step validation on form submission, specify the |
value | number|null | – | The raw numeric value of the field. |
booleantrue |
Whether the component renders a native |
booleantrue |
Whether the component renders a native |
"vertical"'horizontal' |
Cursor movement direction in the scrub area. |
pixelSensitivity | number | 2 | Determines how many pixels the cursor must move before the value changes. A higher value will make scrubbing less sensitive. |
teleportDistance | number | – | If specified, determines the distance that the cursor may move from the center of the scrub area before it will loop back around. |