Skip to content

Number Input

Numeric input for entering values.

Installation

Anatomy

Usage

Controlled

Use value and onValueChange to control the number input. Keep the value as a string when using formatOptions to preserve locale formatting.

Select the number 3

States

Disabled

Use the disabled prop to disable the number input.

Invalid

Use the invalid prop to mark the number input as invalid.

Sizes

Use the size prop to change the input height.

Small

Medium

Large

Examples

Field Only

With Field

Use Field, FieldLabel, and FieldDescription for a labeled number input with helper text.

0 - 100 only

With Input Group

Use InputGroup, InputGroupAddon, and InputGroupText to add prefix or suffix.

EUR

With Scrub

Use the NumberInputScrubber to drag the label to change the value.

With Range

Pass min and max to restrict the value to the specified range.

Use clampValueOnBlur={false} to allow typing outside range until blur.

With Formatted Value

Use formatOptions with Intl.NumberFormatOptions to format the displayed value.

With Step

Use the step prop to set the increment/decrement amount.

Mouse Wheel

Use the allowMouseWheel prop to increment or decrement the value with the mouse wheel.

API Reference

NumberInput

Root component. Manages numeric value and stepper controls.

NumberInputGroup

Wraps the input and increment/decrement buttons.

NumberInputDecrement

Decreases the value by the step amount.

NumberInputIncrement

Increases the value by the step amount.

NumberInputInput

Numeric input. Accepts number or direct typing.

NumberInputScrubber

Drag area for scrubbing the value.


For a complete list of props, see the Ark UI documentation.