Input
Number Stepper
NewA number field with minus and plus buttons where the value rolls up or down as it changes.
npx motionsnack add number-stepper-inputCustomize
<NumberStepperInput />Props
24 properties
| Property | Type | Default | Description |
|---|---|---|---|
| value | number | - | Controlled value. Leave undefined to let the component manage it. |
| defaultValue | number | 2 | Value on first render when uncontrolled. |
| onChange | (value: number) => void | - | Called with the new number on every change. |
| largeStep | number | 10 × step | Amount Shift+arrow and PageUp / PageDown add or take away. |
| locale | string | 'en-US' | Locale that formats the number and reads the decimal separator. |
| errorColor | string | undefined | Error colour for both themes. Undefined uses the per-theme pair. |
| duration | number | - | Deprecated: the roll uses the standard 300ms. |
| name | string | - | Name submitted with a form. |
| id | string | generated | Id of the input. |
| className | string | '' | Extra classes on the wrapper. |
| label | string | 'Guests' | Label above the field. Empty hides it. |
| min | number | 1 | Smallest value. |
| max | number | 12 | Largest value. |
| step | number | 1 | Amount one press adds or takes away. |
| unit | string | 'people' | Text after the number. Empty hides it. |
| helperText | string | 'Up to 12 people per booking.' | Small text under the field. Empty hides it. |
| layout | 'split' | 'end' | 'split' | Buttons on both sides, or both stacked at the end. |
| holdToRepeat | boolean | true | Keep stepping while a button is held down. |
| error | string | '' | Error message. Any text switches the field to its error state. |
| required | boolean | false | Marks the field as required. |
| readOnly | boolean | false | Focusable and announced, but the value cannot change. |
| disabled | boolean | false | Disables the field. |
| height | number | 48 | Height of the field (48, or 40 compact). |
| radius | number | 12 | Corner radius of the field. |
About Number Stepper
Number Stepper is for quantities: guests, tickets, nights or pieces. The minus and plus buttons sit on both sides, or stacked as arrows at the end, and holding one keeps stepping. Each change rolls the number up or down in the direction it moved. The field can still be typed into, and arrow keys, Shift for steps of ten, Home and End work as on a native spin button. Minimum, maximum, step with decimals and a unit after the number are props.
What's included
- Minus and plus on the sides, or arrows at the end
- Number that rolls in the direction of the change
- Hold to repeat
- Typing and keyboard stepping
- Min, max, step and unit
- Light and dark look
- Type
- Animated React input component
- Library
- Components · Input
- Stack
- Next.js, React, Tailwind CSS
- Added
- 2026-11-23
- Install
npx motionsnack add number-stepper-input