Skip to content

Number Stepper

Recessed numbers and tactile keys make a small control feel substantial.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import NumberStepper from "./NumberStepper";
export default function Example() {
return (
<NumberStepper
defaultValue={3}
min={0}
max={12}
step={1}
label={"EDITION SIZE"}
color={"#e7c9a6"}
background={"#27221e"}
disabled={false}
/>
);
}

Using Number Stepper

Set min, max, and step for the values your application accepts. label explains the quantity being changed.

Use value with onValueChange for form state, or defaultValue for an initial local value. The spinbutton supports arrow keys as well as Home and End.

Props

NameTypeRequiredDefaultDescription
valuenumberNoundefinedOptional controlled numeric value.
defaultValuenumberNo1Initial value when uncontrolled.
onValueChangefunctionNoundefinedCalled with the clamped numeric value after a change.
minnumberNo0Inclusive lower bound.
maxnumberNo99Inclusive upper bound, clamped to at least min.
stepnumberNo1Positive increment; invalid steps use one.
labelstringNo"Quantity"Visible and accessible label.
disabledbooleanNofalseDisable all input.
colorstringNo"#e7c9a6"Text and focus colour.
backgroundstringNo"#27221e"Control surface colour.
decreaseLabelstringNo"Decrease"Accessible minus button label.
increaseLabelstringNo"Increase"Accessible plus button label.
classNamestringNo""Additional classes for the root element.
styleCSSPropertiesNoundefinedInline styles for caller-defined size, typography, and appearance.

Related components

A recessed password field pairs a reveal control with an optional strength indicator.

Editable tags collect inside a softly framed input with individual remove controls.

A recessed search field expands into a polished capsule as you type.

Faceted stars lift into selection with a small marker beneath the chosen rating.