formsinput-number
InputNumber
Numeric input with increment and decrement controls, step, and min/max constraints.
Import#
Slot Structure#
Numeric input with increment/decrement controls placed inline (horizontal) or stacked (vertical).
Horizontal#
Vertical#
Examples#
Variants#
Visual style variants for the input shell.
Sizes#
Size scale from xs to xl for input height and control rail sizing.
Orientations#
Horizontal (default) and vertical button layouts.
Controlled#
Value bound to a signal with live readout.
Disabled#
Non-interactive disabled state.
Long Press#
Press and hold increment or decrement to continuously step the value. Set holdRepeat={false} to disable the repeat behavior.
Min / Max / Step#
Constrained ranges and custom step increments.
API Reference#
Attributes#
Slot
root4 attributesNumber input wrapper that owns the input and step controls.
Data Attributes
| Data Attribute | Description |
|---|---|
| data-orientation | Stores the rendered orientation. |
| data-size | Stores the resolved size variant. |
| data-variant | Stores the resolved visual variant. |
ARIA Attributes
| ARIA Attribute | Description |
|---|---|
| role | Defines the semantic role exposed to assistive technology. |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
| autofocus | boolean | undefined | false | Whether to automatically focus the input on mount. |
| autofocusDelay | number | undefined | 0 | Delay in milliseconds before focusing the input. |
| class | ClassValue | — | Class applied to the component root or trigger element. |
| classes | InputNumberT.Classes | undefined | — | — |
| decrement | boolean | undefined | true | Whether to show the decrement button. |
| decrementDisabled | boolean | undefined | — | Whether the decrement button is disabled. |
| decrementIcon | IconT.Name | orientation === 'vertical' ? 'icon-chevron-down' : 'icon-minus | Icon for the decrement button. |
| defaultValue | string | number | undefined | — | Default displayed value for uncontrolled usage. |
| disabled | boolean | undefined | false | Whether the input is disabled. |
| holdRepeat | boolean | undefined | true | Whether press-and-hold should trigger repeated value changes. |
| id | string | undefined | — | The ID of the input element. |
| increment | boolean | undefined | true | Whether to show the increment button. |
| incrementDisabled | boolean | undefined | — | Whether the increment button is disabled. |
| incrementIcon | IconT.Name | orientation === 'vertical' ? 'icon-chevron-up' : 'icon-plus | Icon for the increment button. |
| largeStep | number | undefined | step * 10 | The step size used for PageUp/PageDown. |
| locale | string | undefined | — | Locale for number formatting and parsing.
Uses browser default if not specified. |
| maxValue | number | undefined | — | Maximum allowed numeric value. |
| minValue | number | undefined | — | Minimum allowed numeric value. |
| name | string | undefined | — | The name of the input element, used for form submission. |
| onBlur | JSX.FocusEventHandlerUnion<HTMLInputElement, FocusEvent> | undefined | — | Callback when the input loses focus. |
| onChange | ((value: string) => void) | undefined | — | Callback when the formatted string value changes. |
| onDecrementClick | JSX.EventHandlerUnion<HTMLButtonElement, MouseEvent> | undefined | — | Callback when the decrement button is clicked. |
| onFocus | JSX.FocusEventHandlerUnion<HTMLInputElement, FocusEvent> | undefined | — | Callback when the input gains focus. |
| onIncrementClick | JSX.EventHandlerUnion<HTMLButtonElement, MouseEvent> | undefined | — | Callback when the increment button is clicked. |
| onRawValueChange | ((value: number) => void) | undefined | — | Callback when the numeric value changes. |
| orientation | InputNumberOrientation | undefined | horizontal | The orientation of the control buttons. |
| placeholder | string | undefined | — | Placeholder text for the input. |
| rawValue | number | undefined | — | Controlled numeric value. Takes precedence over `value`. |
| readOnly | boolean | undefined | false | Whether the input is read-only. |
| ref | JSX.HTMLElementTags["div"] extends { ref?: infer Ref; } ? Ref : never | undefined | — | — |
| repeatDelayMs | number | undefined | 500 | Delay in milliseconds before repeated value changes start. |
| repeatIntervalMs | number | undefined | 80 | Interval in milliseconds between repeated value changes. |
| repeatPointerTypes | "all" | PointerType | undefined | all | Pointer types that can trigger press-and-hold repeat. |
| repeatThrottleMs | number | undefined | 0 | Minimum elapsed time in milliseconds between repeat triggers. |
| required | boolean | undefined | false | Whether the input is required. |
| size | "xs" | "sm" | "md" | "lg" | "xl" | undefined | — | — |
| step | number | undefined | 1 | The increment/decrement step size. |
| style | JSX.CSSProperties | undefined | — | — |
| styles | InputNumberT.Styles | undefined | — | — |
| value | string | number | undefined | — | Controlled displayed value. |
| variant | "none" | "outline" | "ghost" | "subtle" | undefined | — | — |
| wheel | boolean | undefined | false | Whether mouse wheel changes the value while the input is focused. |