Skip to Content
Puzzle

Number Input

Enter bounded numeric values with increment controls.

Import

import { NumberInput } from "@puzzle-ui/ui";

Bounds and precision

Use initialValue for uncontrolled input, or value and onChange for controlled input. The callback receives a number, not an event.

390 × 350

API

PropTypeDefaultDescription
valuenumber-Controlled value.
initialValuenumber0Initial uncontrolled value.
onChange(value: number) => void-Updated numeric value.
min, maxnumber-Inclusive bounds.
stepnumber1Increment amount.
largeStepnumberstep * 10PageUp/PageDown increment.
fractionDigitsnumberStep precisionDecimal precision, bounded to 0-12.
longPressDelaynumber450Delay before repeated increments, in milliseconds.
repeatIntervalnumber120Repeat interval, in milliseconds.
decrementLabel, incrementLabelstring"Decrease value", "Increase value"Accessible control labels.

Native input attributes such as name, disabled, readOnly, and aria-describedby are supported. Arrow keys increment/decrement; PageUp/PageDown apply largeStep. Use a visible label.

;