InputNumber

A field for a number, like a price, a count or a percentage, with a range, a precision and stepper buttons.

Basic

Set min and max to keep the value in range, and step it by one with the arrow keys or the arrows shown on hover.

Sizes

Set size to large or small to make the field taller or shorter than the default medium.

Variants

Set variant to outlined, filled, text, underlined, borderless or bare to match the field to its surroundings. text fills on hover and while focused, and bare draws nothing at all.

Spinner mode

Set mode to spinner to replace the stacked arrows with a minus and a plus on either side of the value, which suits touch screens.

Spinner sizes

Set size on a spinner to scale the field and its minus and plus buttons together.

Spinner variants

Every variant works in spinner mode, and each one keeps the dividers between the buttons and the value.

Spinner controls

Pass controls an object with upIcon and downIcon to change the button icons.

Status and disabled

Set status to warning or error to color the field, or set disabled or readOnly to stop edits.

Out-of-range value

min and max pull a typed value back into range on blur, but not a value you set, so derive status from it.

Precision

Set precision to fix the number of decimal places, and step to how far each step moves, like two places and steps of 0.1.

String mode

Set stringMode to keep the value as a string, for numbers with more digits than a JavaScript number can hold.

Formatter and parser

Pair formatter with parser to show the number your way and read it back, like a $ 1,000 amount or a 50% share.

Prefix and suffix

Set prefix or suffix to show a unit inside the field, like $ or kg, or join the field to a unit Select with Space.Compact.

Keyboard and wheel

Set keyboard to turn arrow-key stepping on or off, and changeOnWheel to let the scroll wheel step the value while the field has focus.

In context

The component inside real screens, with the components it usually sits beside.

Cart line item

A cart line with a spinner quantity that stops at one and updates the line total as it changes.

Guests and rooms

A booking panel with spinner counters for adults, children and rooms, each with its own minimum, and a summary of the choice.

API Reference

InputNumber
InputNumber's props. Rows marked antuikit in the Version column are added by the kit.