Usage
Props
Controlled value of the input.
Default value for uncontrolled mode.
Called when the value changes. Receives the numeric value.
Minimum allowed value. Decrements are disabled when reached.
Maximum allowed value. Increments are disabled when reached.
Amount to increment/decrement when using controls.
Number of decimal places to display and round to.
Label text displayed above the input.
Placeholder text when input is empty.
Error message to display below the input.
Disables the input and controls.
Makes the input read-only (controls still work).
Hides the increment/decrement buttons.
Size variant matching Input component sizes.
Additional CSS classes to apply to the input element.
HTML ID attribute. Auto-generated if not provided.
Examples
Basic Number Input
With Step Controls
Without Controls
Different Sizes
With Error State
Decimal Precision
Controlled Cart Quantity
Disabled and Read-Only
Notes
- Values are automatically clamped to min/max bounds
- Precision controls decimal places via
toFixed() - Increment (+) and decrement (−) buttons are visible by default
- Controls disable when min/max limits are reached
- Native HTML5 number input with hidden spinners
- Manual input is validated and clamped on change
- Focus ring appears on the entire control group
- Controls have hover states for better UX