Flutter docs
Default skin

InputNumber

Enter a number within certain range with the mouse or keyboard.

When to use

When a numeric value needs to be provided.

Examples

Basic

Numeric-only input box.

Disabled

Click the button to toggle between available and disabled states.

Formatter

Display value within it's situation with formatter, and we usually use parser at the same time. A currency wrapper is the usual pairing for it.

Wheel

Control with mouse wheel.

Spinner

Digit spinner.

Prefix / Suffix

Add a prefix or suffix inside input.

Focus

Focus with additional option.

Sizes

There are three sizes available to a numeric input box. By default, the size is 32px. The two additional sizes are large and small which means 40px and 24px, respectively.

High precision decimals

Use stringMode to support high precision decimals support. onChange will return string value instead. You need polyfill of BigInt if browser not support.

Keyboard

Control keyboard behavior by keyboard.

Variants

Variants of InputNumber, there are four variants: outlined filled borderless and underlined.

Out of range

Show warning style when value is out of range by control.

Status

Add status to InputNumber with status, which could be error or warning.

Custom semantic dom styling

You can customize the semantic dom style of the InputNumber by passing objects/functions through classNames and styles.

API

InputNumber are exported from @ceebee/ui/client.

InputNumber

PropertyDescriptionTypeDefaultVersion
addonAfterThe label text displayed after (on the right side of) the input field, please use Space.Compact insteadReactNode-4.17.0
addonBeforeThe label text displayed before (on the left side of) the input field, please use Space.Compact insteadReactNode-4.17.0
changeOnBlurTrigger onChange when blur. e.g. reset value in range by blurbooleantrue5.11.0
changeOnWheelAllows control with mouse wheelboolean-5.14.0
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-6.0.0
controlsWhether to show +- controls, or set custom arrow iconsboolean | { upIcon?: React.ReactNode; downIcon?: React.ReactNode; }-—
decimalSeparatorDecimal separatorstring--
placeholderPlaceholderstring-—
defaultValueThe initial valuenumber--
disabledIf the input is disabledbooleanfalse-
formatterSpecifies the format of the value presentedfunction(value: number | string, info: { userTyping: boolean, input: string }): string-—
keyboardIf keyboard behavior is enabledbooleantrue—
maxThe max valuenumberNumber.MAX_SAFE_INTEGER-
minThe min valuenumberNumber.MIN_SAFE_INTEGER-
parserSpecifies the value extracted from formatterfunction(string): number--
precisionThe precision of input value. Will use formatter when config of formatternumber--
readOnlyIf the input is readonlybooleanfalse-
statusSet validation status'error' | 'warning'-—
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-6.0.0
prefixThe prefix icon for the InputReactNode-—
suffixThe suffix icon for the InputReactNode-5.20.0
sizeThe height of input boxlarge | medium | small--
stepThe number to which the current value is increased or decreased. It can be an integer or decimalnumber | string1-
stringModeSet value as string to support high precision decimals. Will return string value by onChangebooleanfalse4.13.0
modeShow input or spinner'input' | 'spinner''input'—
valueThe current value of the componentnumber--
variantVariants of Inputoutlined | borderless | filled | underlinedoutlined5.13.0 | underlined: 5.24.0
onChangeThe callback triggered when the value is changedfunction(value: number | string | null)--
onPressEnterThe callback function that is triggered when Enter key is pressedfunction(e)--
onStepThe callback function that is triggered when click up or down buttons / Keyboard / Wheel(value: number, info: { offset: number, type: 'up' | 'down', emitter: 'handler' | 'keydown' | 'wheel' }) => void-—
borderedWhether has border style, please use variant insteadbooleantrue-
blur()Remove focus-——
focus()Get focus(option?: { preventScroll?: boolean, cursor?: 'start' | 'end' | 'all' })cursor - 5.22.0—
nativeElementThe native DOM element-5.17.3—