Number Input

A numeric field with steppers, clamping, and spinbutton keyboard support.

Import#

import { NumberInput } from "astralis-ui";

Typing is free-form — the value parses, clamps to min/max, and rounds to precision when you commit (blur, Enter, or the steppers). onChange receives the committed number, or null when cleared.

Props#

PropTypeDefaultDescription
value / defaultValuenumber | nullControlled / uncontrolled value.
onChange(value: number | null) => voidFires on commit.
min / maxnumberClamping bounds (also aria-valuemin/max).
stepnumber1Arrow/stepper increment.
precisionnumberDecimal places on commit.
hideSteppersbooleanfalseRemove the +/− buttons.
size / variant / invalidas InputShares the Input styling system.

Keyboard#

KeyAction
/ ± step (clamped)
Home / EndJump to min / max
EnterCommit the typed value

Accessibility#

Renders role="spinbutton" with aria-valuemin/max/now and inherits label and description wiring from Field. The stepper buttons are excluded from the tab order — keyboard users get arrows, which are faster.