Client component

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 | nullNoneControlled / uncontrolled value.
onChange(value: number | null) => voidNoneFires on commit.
min / maxnumberNoneClamping bounds (also `aria-valuemin/max`).
stepnumber1Arrow/stepper increment.
precisionnumberNoneDecimal places on commit.
hideSteppersbooleanfalseRemove the +/− buttons.
size / variant / invalidas Inputas 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.