"use client";
import { NumberField } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
showSteppers | boolean | — | − / + buttons after the input (step, clamped to min/max). |
value | number | string | null | — | The number (controlled); null for empty, the type onValueChange reports. A string controls the raw text instead (keep drafts like - or 1. while typing; read it in onChange). |
defaultValue | number | null | — | Initial number when uncontrolled; null for empty. |
invalid | boolean | — | Marks the control invalid (aria-invalid); FormField sets it from error. |
onValueChange | ( value: number | null, event: ChangeEvent<HTMLInputElement>, ) => void | — | Called with the new value (only when it changes). |
size | ComponentSize | — | Size from the shared scale (xs, sm, md, lg). |
showSteppersboolean
− / + buttons after the input (step, clamped to min/max).
valuenumber | string | null
The number (controlled); null for empty, the type onValueChange reports. A string controls the raw text instead (keep drafts like - or 1. while typing; read it in onChange).
defaultValuenumber | null
Initial number when uncontrolled; null for empty.
invalidboolean
Marks the control invalid (aria-invalid); FormField sets it from error.
onValueChange( value: number | null, event: ChangeEvent<HTMLInputElement>, ) => void
Called with the new value (only when it changes).
sizeComponentSize
Size from the shared scale (xs, sm, md, lg).
Other props are passed to the root element (InputHTMLAttributes<HTMLInputElement>), including className, style, id and aria-* attributes.
Complex object props use fixed fixtures. Primitive props stay editable.
<NumberField aria-label="Width" value={24} showSteppers={true} /><NumberField showSteppers value={24} /><NumberField aria-label="Width" value={24} showSteppers={true} />