InputNumber

An input component that can only enter numbers.

Import

import { InputNumber } from 'rsuite';

// or
import InputNumber from 'rsuite/InputNumber';

Examples

Basic

Size

Decimals

Limits

limits: 10 - 100

Step

Disabled and read only

Combination

Controlled

Props

<InputNumber>

Property Type (Default) Description
classPrefix string ('input-number') The prefix of the component CSS class.
defaultValue number Default value.
disabled boolean Disabled component.
max number (Infinity) Maximum value.
min number (-Infinity) Minimum value.
onChange (value: number , event) => void The callback function when value changes.
postfix ReactNode Sets the element displayed on the right side of the component.
prefix ReactNode Sets the element displayed to the left of the component.
scrollable boolean (true) Whether the value can be changed through the wheel event.
size 'lg' | 'md' | 'sm' | 'xs' ('md') An input can have different sizes.
step number (1) The value of each step. can be decimal.
value number Value (Controlled).
Vercel banner