NumberStepper

Digits roll up or down depending on direction. Inputs.

Open playground
2

About

NumberStepper is a React component in the Inputs category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { NumberStepper } from "@ashutoshswamy/smoui" and set defaultValue, min, max among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { NumberStepper } from "@ashutoshswamy/smoui";

<NumberStepper defaultValue={2} max={9} className="text-3xl" />

Props 4

defaultValue

Initial value.

numberdefault 1
min

Lower bound.

numberdefault 0
max

Upper bound.

numberdefault 99
onChange

Called on change.

(value: number) => void