Number Input

The NumberInput component captures numeric values with optional min, max, step, and increment controls.

Usage & Examples

Seats

seats.tsx
<NumberInput
    label="Seats"
    defaultValue={12}
    min={1}
    max={50}
    step={1}
  />

Props API

34 props
Columns
Number Input props API
Default
Description
clampOnBlurbooleanNopropstrueWhether to clamp values to min/max on blur and when using stepper buttons.
classNamestringNostylingAdditional class name for the component root.
containerClassNamestringNopropsAdditional class name for the outer label/input container.
controlsClassNamestringNopropsAdditional class name for the stepper controls wrapper.
data-testidstringNotestingBackward-compatible alias for test ID attributes.
decrementAriaLabelstringNoprops"Decrease value"Accessible label for the decrement control.
decrementButtonClassNamestringNopropsAdditional class name for the decrement button.
defaultValuenumber | ""Noprops""Initial numeric value for uncontrolled usage.
errorMessageReactNodeNoprops-
helperTextReactNodeNoprops-
incrementAriaLabelstringNoprops"Increase value"Accessible label for the increment control.
incrementButtonClassNamestringNopropsAdditional class name for the increment button.