Zephora UI

Form

InputNumber

Numeric spinbutton with increment/decrement stepper buttons, min/max clamping, custom step and keyboard support. The value is a number or null when empty.

Import

import { InputNumber } from "@zephora/react";

Examples

Basic

Uncontrolled with a default value; use the steppers or arrow keys.

Min / max / step

Values are clamped to the bounds; Home/End jump to min/max.

Controlled

`onValueChange` reports the parsed number, or null when cleared.

Selected seats: 2

API

InputNumber props

PropTypeDefaultDescription
valuenumber | nullControlled value; null means empty.
defaultValuenumber | nullnullInitial value (uncontrolled).
onValueChange(value: number | null) => voidCalled with the parsed value (or null when cleared).
minnumberLower bound; values are clamped to it.
maxnumberUpper bound; values are clamped to it.
stepnumber1Step used by the buttons and arrow keys.
size"sm" | "md" | "lg""md"Control size.
invalidbooleanfalseMarks the field invalid: sets aria-invalid and error styling.
unstyledbooleanfalseHeadless mode — drops Zephora classes so your own CSS can style it.
…restInputHTMLAttributes<HTMLInputElement>Remaining native input props are forwarded (type, value, onChange, min, max and step are managed by the component).

Keyboard

KeyAction
Arrow Up / Arrow DownIncrement / decrement by step.
Home / EndJump to min / max (when defined).
Type + BlurFree-typed text is parsed and clamped on blur.