Number Input
The number input provides controls for editing, incrementing or decrementing numeric values using the keyboard or pointer.
The number input provides controls for editing, incrementing or decrementing numeric values using the keyboard or pointer.
API reference docs for the component. Learn about the props, CSS, and other APIs of this exported module.
boolean
Whether to allow mouse wheel to change the value
boolean
Whether to allow the value overflow the min/max range
boolean
Whether to clamp the value when the input loses focus (blur)
string
'ltr' | 'rtl'
The document's text/writing direction.
boolean
Whether the number input is disabled.
boolean
Whether to focus input when the value changes
string
The associate form of the input element.
(value: string) => string | number
If using a custom display format, this converts the default format to the custom format.
() => ShadowRoot | Node | Document
A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.
string
The unique identifier of the machine.
Partial<{ 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
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
boolean
Whether the number input value is invalid.
number
The maximum value of the number input
number
The maximum number of fraction digits to use. Possible values are from 0 to 20;
number
The minimum value of the number input
number
The minimum number of fraction digits to use. Possible values are from 0 to 20
string
The name attribute of the number input. Useful for form submission.
(details: FocusChangeDetails) => void
Function invoked when the number input is focused
(details: ValueChangeDetails) => void
Function invoked when the value changes
(details: ValueInvalidDetails) => void
Function invoked when the value overflows or underflows the min/max range
(value: string) => string
If using a custom display format, this converts the custom format to a format `parseFloat` understands.
string
The pattern used to check the <input> element's value against
boolean
Whether the number input is readonly
boolean
Whether to spin the value when the increment/decrement button is pressed
number
The amount to increment or decrement the value by
IntlTranslations
Specifies the localized strings that identifies the accessibility elements and their states
(char: string) => boolean
Whether the pressed key should be allowed in the input. The default behavior is to allow DOM floating point characters defined by /^[Ee0-9+\-.]$/
string
The value of the input
() => void
Function to blur the input.
() => void
Function to clear the value of the input.
Dict<any>
() => void
Function to decrement the value of the input by the step.
Dict<any>
() => void
Function to focus the input.
() => void
Function to increment the value of the input by the step.
Dict<any>
Dict<any>
boolean
Whether the input is focused.
boolean
Whether the input is invalid.
boolean
Whether the input value is empty.
Dict<any>
Dict<any>
Dict<any>
() => void
Function to set the value of the input to the max.
() => void
Function to set the value of the input to the min.
(value: string | number) => void
Function to set the value of the input.
string
The formatted value of the input.
number
The value of the input as a number.