Number Field
A numeric input with stepper buttons and a scrub area. Supports min/max clamping, step size, locale-aware formatting, and keyboard/scroll input.
NumberField
base-ui docs ↗A numeric input with stepper buttons and a scrub area. Supports min/max
clamping, step size, locale-aware formatting, and keyboard/scroll input.
| Prop | Type | Default |
|---|---|---|
| label | ReactNode | — |
Visible label text. When present a scrub-area is also rendered. | ||
| defaultValue | number | — |
Initial value (uncontrolled). | ||
| value | number | null | — |
Current value (controlled). | ||
| onValueChange | ((value: number | null) => void) | — |
Called when the value changes. | ||
| min | number | — |
Minimum allowed value. | ||
| max | number | — |
Maximum allowed value. | ||
| step | number | 1 |
Increment/decrement step size. | ||
| disabled | boolean | — |
Prevent interaction. | ||
| readOnly | boolean | — |
Allow reading but not editing. | ||
| required | boolean | — |
Mark the field as required for form validation. | ||
| name | string | — |
HTML name attribute for form submission. | ||
| format | NumberFormatOptions | — |
| ||
| allowWheelScrub | boolean | — |
Allow changing the value by scrolling the mouse wheel. | ||
| className | string | — |
Styled Parts
base-ui docs ↗Pre-styled wrappers around the corresponding base-ui parts. All base-ui props are forwarded.
CSS Class Names
Available as keys on the NumberFieldStyles object. Each key maps to a hashed CSS module class name at runtime.
decrementgroupincrementinputlabelrootscrub-areascrub-area-cursorstep-button