Forms v1.0.0

Number Input

Numeric input with increment/decrement buttons, min/max constraints, and step size. Provides a better UX than native number inputs with consistent cross-browser styling. Supports prefix/suffix text, multiple sizes, error states, and hold-to-repeat on buttons.

Preview & Code

Options

Name Type Default Description
value Integer/Float nil Initial numeric value
min Integer/Float nil Minimum allowed value
max Integer/Float nil Maximum allowed value
step Integer/Float 1 Increment/decrement step size
label String nil Label text displayed above the input
hint String nil Hint text displayed below the input
size Symbol :md Input size: :sm, :md, or :lg
prefix String nil Prefix text displayed inside the input (e.g. "$")
suffix String nil Suffix text displayed inside the input (e.g. "kg")
disabled Boolean false Whether the input is disabled
error String nil Error message — turns the border red and displays below the input
name String nil Form field name attribute
placeholder String nil Placeholder text shown when empty

Changelog v1.0.0

- v1.0.0: Initial release with increment/decrement buttons, min/max/step support
- Hold-to-repeat on increment/decrement buttons (400ms delay, 75ms repeat)
- Keyboard arrow-key support (ArrowUp/ArrowDown)
- Prefix/suffix text, multiple sizes, error states, and disabled state
- Full dark mode support

Get Full Access

Unlock the source code for this component and all others. One-time payment for lifetime access.

Get Access Now