Skip to main content

Variable: NumberInput

const NumberInput: object;

Defined in: react/src/components/NumberInput/index.tsx:605

Input with some useful functions for entering numerical values.

Type Declaration​

DecrementStepper​

DecrementStepper: (props) => Element;

Lowers the value by one step, repeating while held.

Parameters​

ParameterType
propsStepperButtonProps

Returns​

Element

IncrementStepper​

IncrementStepper: (props) => Element;

Raises the value by one step, repeating while held.

Parameters​

ParameterType
propsStepperButtonProps

Returns​

Element

InputField​

InputField: ForwardRefExoticComponent<Props & RefAttributes<HTMLInputElement>>;

The text field of a NumberInput, and the only place the value can be typed.

While the user types, their own text stands rather than format(value), so that a half-finished entry is not rewritten under the caret.

How it behaves on focus, Enter and the arrow keys is set on Root (selectOnFocus, unformatOnFocus, keepCaretOnStep, blurOnEnter).

Root​

Root: ForwardRefExoticComponent<NumberInputProps & Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof NumberInputProps> & RefAttributes<HTMLDivElement>>;

Stepper​

Stepper: ForwardRefExoticComponent<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;

The area the steppers sit in, and a drag handle in its own right: dragging it up and down moves the value one step every drag pixels. The counting is createStepperDrag in the core.

The drag lives here rather than on InputField because createDrag turns off text selection on whatever element it is attached to.