Number Field

A numeric input element with increment and decrement buttons, and a scrub area.

API reference

Import the component and place its parts the following way:

Anatomy
import { NumberField } from '@base-ui-components/react/number-field';

<NumberField.Root>
  <NumberField.Group>
    <NumberField.Decrement />
    <NumberField.Input />
    <NumberField.Increment />
    <NumberField.ScrubArea>
      <NumberField.ScrubAreaCursor />
    </NumberField.ScrubArea>
  </NumberField.Group>
</NumberField.Root>

Root

The foundation for building custom-styled number fields.

PropTypeDefault
allowWheelScrubbooleanfalse
autoFocusbooleanfalse
classNamestring | (state) => stringundefined
defaultValuenumberundefined
disabledbooleanfalse
formatIntl.NumberFormatOptionsundefined
idstringundefined
invalidbooleanfalse
largeStepnumber10
maxnumberundefined
minnumberundefined
namestringundefined
onValueChange(value, event) => voidundefined
readOnlybooleanfalse
render| React.ReactElement
| (props, state) => React.ReactElement
undefined
requiredbooleanfalse
smallStepnumber0.1
stepnumberundefined
valuenumberundefined

Group

Groups interactive NumberField components together.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Decrement

The decrement stepper button.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Input

The input element for the number field.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Increment

The increment stepper button.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Scrub Area

The scrub area element.

PropTypeDefault
classNamestring | (state) => stringundefined
direction'horizontal' | 'vertical''horizontal'
pixelSensitivitynumber2
render| React.ReactElement
| (props, state) => React.ReactElement
undefined
teleportDistancenumberundefined

Scrub Area Cursor

The scrub area cursor element.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined