‮Skip to content‬
uiify

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

‮Prop‬‮Type‬‮Default‬‮Description‬
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.‬
stepnumber1‮Amount added or removed by the increment and decrement buttons.‬
formatOptionsIntl.NumberFormatOptions—‮Options for the Intl.NumberFormat used to display the value.‬
clampValueOnBlurbooleantrue‮Pulls an out-of-range value back inside min and max when the input blurs.‬
disabledbooleanfalse‮Disables the input and both stepper buttons.‬
readOnlybooleanfalse‮Makes the value read-only while keeping the input focusable.‬
requiredbooleanfalse‮Marks the input as required for form validation.‬
renderReactElement | ((props, state) => ReactElement)—‮Replace the rendered element while keeping behavior and accessibility wiring.‬

NumberField.Group

‮Prop‬‮Type‬‮Default‬‮Description‬
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

‮Prop‬‮Type‬‮Default‬‮Description‬
renderReactElement | ((props, state) => ReactElement)—‮Replace the rendered element while keeping behavior and accessibility wiring.‬

NumberField.Increment

‮Prop‬‮Type‬‮Default‬‮Description‬
childrenReactNode—‮Content of the increment button.‬
renderReactElement | ((props, state) => ReactElement)—‮Replace the rendered element while keeping behavior and accessibility wiring.‬

NumberField.Decrement

‮Prop‬‮Type‬‮Default‬‮Description‬
childrenReactNode—‮Content of the decrement button.‬
renderReactElement | ((props, state) => ReactElement)—‮Replace the rendered element while keeping behavior and accessibility wiring.‬

‮Keyboard‬

‮Key‬‮Action‬
Tab‮Move focus to/from the control‬
Enter / Space‮Activate 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