Import
Usage
NumberInput Props
HTML id for the input field and label association.
The current numeric value.
Minimum allowed value. Decrement button is disabled when value reaches min.
Maximum allowed value. Increment button is disabled when value reaches max.
The amount to increment/decrement by.
When true, displays a text input field between the buttons. When false, only shows increment/decrement buttons.
Callback fired when the increment button is clicked. Receives the event, button element, and optionally the input element if
input is true.Callback fired when the decrement button is clicked. Receives the event, button element, and optionally the input element if
input is true.Object-based class names for conditional styling.
All standard HTML input attributes are supported (except
type and standard class).Examples
Behavior
When
input is true, the increment/decrement callbacks receive the input element as the third parameter. The component automatically calls stepUp() and stepDown() on the input element before firing the callbacks. Browser default spin buttons are hidden via CSS.Accessibility
- Buttons have
aria-labelattributes (“Increment” and “Decrement”) - Buttons are properly disabled when min/max limits are reached
- Label is associated with input via
forattribute touch-manipulationprevents double-tap zoom on mobile- Number input has type=“number” for proper keyboard on mobile devices