Skip to content

Number field

Numeric input with steppers.

Browsers
Chrome 123+Firefox 121+Safari 17.5+
Tier
1
Bundle compressed
2.45 kB
Forced layout budget
0 ms
Axe budget
0
SSR compatible
Yes
Published contract
Test harness

Playground

Number Field

Default

API

NumberField.Root

PropTypeDefaultDescription
valuenumber—Current number, making the field controlled.
defaultValuenumber—Starting number for the uncontrolled field.
onValueChange(value: number | undefined) => void—Called with the parsed number, or undefined when the input is empty.
minnumber—Lowest accepted value.
maxnumber—Highest accepted value.
stepnumber1Amount added or removed by the increment and decrement buttons.
formatOptionsIntl.NumberFormatOptions—Options for the Intl.NumberFormat used to display the value.
clampValueOnBlurbooleantruePulls an out-of-range value back inside min and max when the input blurs.
disabledbooleanfalseDisables the input and both stepper buttons.
readOnlybooleanfalseMakes the value read-only while keeping the input focusable.
requiredbooleanfalseMarks the input as required for form validation.
renderReactElement | ((props, state) => ReactElement)—Replace the rendered element while keeping behavior and accessibility wiring.

NumberField.Group

PropTypeDefaultDescription
childrenReactNode—The input and stepper buttons wrapped by the group.
renderReactElement | ((props, state) => ReactElement)—Replace the rendered element while keeping behavior and accessibility wiring.

NumberField.Input

PropTypeDefaultDescription
renderReactElement | ((props, state) => ReactElement)—Replace the rendered element while keeping behavior and accessibility wiring.

NumberField.Increment

PropTypeDefaultDescription
childrenReactNode—Content of the increment button.
renderReactElement | ((props, state) => ReactElement)—Replace the rendered element while keeping behavior and accessibility wiring.

NumberField.Decrement

PropTypeDefaultDescription
childrenReactNode—Content of the decrement button.
renderReactElement | ((props, state) => ReactElement)—Replace the rendered element while keeping behavior and accessibility wiring.

Keyboard

KeyAction
TabMove focus to/from the control
Enter / SpaceActivate when focused (button-like controls)

Accessibility

Uses semantic HTML where possible. Inspect rendered markup in the playground — ARIA is added only when native elements are insufficient.

Styling hooks

data-uiify-number-fielddata-disabled