Skip to content

NumberInput

Numeric input field with optional min/max bounds and step control.

<ControlledNumberInput {...args} />
GB
<ControlledNumberInput {...args} />
<div style={{display: 'flex', flexDirection: 'column', gap: 16}}>
<ControlledNumberInput label="Small" size="sm" value={10} />
<ControlledNumberInput label="Medium" size="md" value={20} />
<ControlledNumberInput label="Large" size="lg" value={30} />
</div>
<ControlledNumberInput {...args} />
Value is unusually high
Value is valid
<div style={{display: 'flex', flexDirection: 'column', gap: 16}}>
<ControlledNumberInput
label="Error"
status={{message: 'Value is out of range', type: 'error'}}
value={999}
/>
<ControlledNumberInput
label="Warning"
status={{message: 'Value is unusually high', type: 'warning'}}
value={95}
/>
<ControlledNumberInput
label="Success"
status={{message: 'Value is valid', type: 'success'}}
value={50}
/>
</div>
<ControlledNumberInput {...args} />
<ControlledNumberInput {...args} />
<ControlledNumberInput {...args} />
<ControlledNumberInput {...args} />
<ControlledNumberInput {...args} />
<ControlledNumberInput {...args} />
Enter a value between 1 and 100
<ControlledNumberInput {...args} />
<ControlledNumberInput {...args} />
USD
<ControlledNumberInput {...args} />
<ControlledNumberInput {...args} />

Numeric input field with optional min/max bounds and step control.

When isOptional: false, isRequired: false, hasClear: true

PropTypeDefaultDescription
autoCompletestringHTML autocomplete attribute value.
classNamestringAdditional CSS class names applied to the field root, or to the input wrapper when the input is inside an InputGroup.
data-testidstringTest ID applied to the input element.
descriptionReactNodeSupporting text displayed below the label.
endContentReactNodeContent rendered after the input, before the status icon.
hasAutoFocusbooleanfalseWhether to focus the input on mount.
htmlNamestringHTML name attribute.
isDisabledbooleanfalseWhether the input is disabled.
isIntegerOnlybooleanfalseWhether to restrict input to integer values only.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the input is in a loading state.
label*stringField label.
labelIconIconComponentIcon rendered beside the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxnumber | nullMaximum allowed value.
minnumber | nullMinimum allowed value.
onBlur(event: FocusEvent<HTMLInputElement>) => voidCalled when the input loses focus.
onEnter() => voidCalled when Enter is pressed.
onFocus(event: FocusEvent<HTMLInputElement>) => voidCalled when the input receives focus.
onKeyDown(event: KeyboardEvent<HTMLInputElement>) => voidKeyboard event handler for the input.
placeholderstringPlaceholder text.
refRef<HTMLInputElement>Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size.
startIconIconComponentIcon shown before the input.
statusInputStatusValidation status displayed below the input.
stepnumber | nullStep increment for the number input.
styleCSSPropertiesInline styles applied to the field root, or to the input wrapper when the input is inside an InputGroup.
unitsstring | nullUnit label displayed after the input value.
value*number | nullControlled numeric value.
isOptionalfalse
isRequiredfalse
hasClear*trueWhether to show a clear button.
onChange*(value: number | null) => voidCalled when the numeric value changes or is cleared.

When isOptional: true, isRequired: false, hasClear: true

PropTypeDefaultDescription
autoCompletestringHTML autocomplete attribute value.
classNamestringAdditional CSS class names applied to the field root, or to the input wrapper when the input is inside an InputGroup.
data-testidstringTest ID applied to the input element.
descriptionReactNodeSupporting text displayed below the label.
endContentReactNodeContent rendered after the input, before the status icon.
hasAutoFocusbooleanfalseWhether to focus the input on mount.
htmlNamestringHTML name attribute.
isDisabledbooleanfalseWhether the input is disabled.
isIntegerOnlybooleanfalseWhether to restrict input to integer values only.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the input is in a loading state.
label*stringField label.
labelIconIconComponentIcon rendered beside the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxnumber | nullMaximum allowed value.
minnumber | nullMinimum allowed value.
onBlur(event: FocusEvent<HTMLInputElement>) => voidCalled when the input loses focus.
onEnter() => voidCalled when Enter is pressed.
onFocus(event: FocusEvent<HTMLInputElement>) => voidCalled when the input receives focus.
onKeyDown(event: KeyboardEvent<HTMLInputElement>) => voidKeyboard event handler for the input.
placeholderstringPlaceholder text.
refRef<HTMLInputElement>Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size.
startIconIconComponentIcon shown before the input.
statusInputStatusValidation status displayed below the input.
stepnumber | nullStep increment for the number input.
styleCSSPropertiesInline styles applied to the field root, or to the input wrapper when the input is inside an InputGroup.
unitsstring | nullUnit label displayed after the input value.
value*number | nullControlled numeric value.
isOptional*true
isRequiredfalse
hasClear*trueWhether to show a clear button.
onChange*(value: number | null) => voidCalled when the numeric value changes or is cleared.

When isOptional: false, isRequired: true, hasClear: true

PropTypeDefaultDescription
autoCompletestringHTML autocomplete attribute value.
classNamestringAdditional CSS class names applied to the field root, or to the input wrapper when the input is inside an InputGroup.
data-testidstringTest ID applied to the input element.
descriptionReactNodeSupporting text displayed below the label.
endContentReactNodeContent rendered after the input, before the status icon.
hasAutoFocusbooleanfalseWhether to focus the input on mount.
htmlNamestringHTML name attribute.
isDisabledbooleanfalseWhether the input is disabled.
isIntegerOnlybooleanfalseWhether to restrict input to integer values only.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the input is in a loading state.
label*stringField label.
labelIconIconComponentIcon rendered beside the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxnumber | nullMaximum allowed value.
minnumber | nullMinimum allowed value.
onBlur(event: FocusEvent<HTMLInputElement>) => voidCalled when the input loses focus.
onEnter() => voidCalled when Enter is pressed.
onFocus(event: FocusEvent<HTMLInputElement>) => voidCalled when the input receives focus.
onKeyDown(event: KeyboardEvent<HTMLInputElement>) => voidKeyboard event handler for the input.
placeholderstringPlaceholder text.
refRef<HTMLInputElement>Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size.
startIconIconComponentIcon shown before the input.
statusInputStatusValidation status displayed below the input.
stepnumber | nullStep increment for the number input.
styleCSSPropertiesInline styles applied to the field root, or to the input wrapper when the input is inside an InputGroup.
unitsstring | nullUnit label displayed after the input value.
value*number | nullControlled numeric value.
isOptionalfalse
isRequired*true
hasClear*trueWhether to show a clear button.
onChange*(value: number | null) => voidCalled when the numeric value changes or is cleared.

When isOptional: false, isRequired: false, hasClear: false

PropTypeDefaultDescription
autoCompletestringHTML autocomplete attribute value.
classNamestringAdditional CSS class names applied to the field root, or to the input wrapper when the input is inside an InputGroup.
data-testidstringTest ID applied to the input element.
descriptionReactNodeSupporting text displayed below the label.
endContentReactNodeContent rendered after the input, before the status icon.
hasAutoFocusbooleanfalseWhether to focus the input on mount.
htmlNamestringHTML name attribute.
isDisabledbooleanfalseWhether the input is disabled.
isIntegerOnlybooleanfalseWhether to restrict input to integer values only.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the input is in a loading state.
label*stringField label.
labelIconIconComponentIcon rendered beside the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxnumber | nullMaximum allowed value.
minnumber | nullMinimum allowed value.
onBlur(event: FocusEvent<HTMLInputElement>) => voidCalled when the input loses focus.
onEnter() => voidCalled when Enter is pressed.
onFocus(event: FocusEvent<HTMLInputElement>) => voidCalled when the input receives focus.
onKeyDown(event: KeyboardEvent<HTMLInputElement>) => voidKeyboard event handler for the input.
placeholderstringPlaceholder text.
refRef<HTMLInputElement>Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size.
startIconIconComponentIcon shown before the input.
statusInputStatusValidation status displayed below the input.
stepnumber | nullStep increment for the number input.
styleCSSPropertiesInline styles applied to the field root, or to the input wrapper when the input is inside an InputGroup.
unitsstring | nullUnit label displayed after the input value.
value*number | nullControlled numeric value.
isOptionalfalse
isRequiredfalse
hasClearfalseWhether to show a clear button.
onChange*(value: number) => voidCalled when the numeric value changes.

When isOptional: true, isRequired: false, hasClear: false

PropTypeDefaultDescription
autoCompletestringHTML autocomplete attribute value.
classNamestringAdditional CSS class names applied to the field root, or to the input wrapper when the input is inside an InputGroup.
data-testidstringTest ID applied to the input element.
descriptionReactNodeSupporting text displayed below the label.
endContentReactNodeContent rendered after the input, before the status icon.
hasAutoFocusbooleanfalseWhether to focus the input on mount.
htmlNamestringHTML name attribute.
isDisabledbooleanfalseWhether the input is disabled.
isIntegerOnlybooleanfalseWhether to restrict input to integer values only.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the input is in a loading state.
label*stringField label.
labelIconIconComponentIcon rendered beside the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxnumber | nullMaximum allowed value.
minnumber | nullMinimum allowed value.
onBlur(event: FocusEvent<HTMLInputElement>) => voidCalled when the input loses focus.
onEnter() => voidCalled when Enter is pressed.
onFocus(event: FocusEvent<HTMLInputElement>) => voidCalled when the input receives focus.
onKeyDown(event: KeyboardEvent<HTMLInputElement>) => voidKeyboard event handler for the input.
placeholderstringPlaceholder text.
refRef<HTMLInputElement>Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size.
startIconIconComponentIcon shown before the input.
statusInputStatusValidation status displayed below the input.
stepnumber | nullStep increment for the number input.
styleCSSPropertiesInline styles applied to the field root, or to the input wrapper when the input is inside an InputGroup.
unitsstring | nullUnit label displayed after the input value.
value*number | nullControlled numeric value.
isOptional*true
isRequiredfalse
hasClearfalseWhether to show a clear button.
onChange*(value: number) => voidCalled when the numeric value changes.

When isOptional: false, isRequired: true, hasClear: false

PropTypeDefaultDescription
autoCompletestringHTML autocomplete attribute value.
classNamestringAdditional CSS class names applied to the field root, or to the input wrapper when the input is inside an InputGroup.
data-testidstringTest ID applied to the input element.
descriptionReactNodeSupporting text displayed below the label.
endContentReactNodeContent rendered after the input, before the status icon.
hasAutoFocusbooleanfalseWhether to focus the input on mount.
htmlNamestringHTML name attribute.
isDisabledbooleanfalseWhether the input is disabled.
isIntegerOnlybooleanfalseWhether to restrict input to integer values only.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the input is in a loading state.
label*stringField label.
labelIconIconComponentIcon rendered beside the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxnumber | nullMaximum allowed value.
minnumber | nullMinimum allowed value.
onBlur(event: FocusEvent<HTMLInputElement>) => voidCalled when the input loses focus.
onEnter() => voidCalled when Enter is pressed.
onFocus(event: FocusEvent<HTMLInputElement>) => voidCalled when the input receives focus.
onKeyDown(event: KeyboardEvent<HTMLInputElement>) => voidKeyboard event handler for the input.
placeholderstringPlaceholder text.
refRef<HTMLInputElement>Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size.
startIconIconComponentIcon shown before the input.
statusInputStatusValidation status displayed below the input.
stepnumber | nullStep increment for the number input.
styleCSSPropertiesInline styles applied to the field root, or to the input wrapper when the input is inside an InputGroup.
unitsstring | nullUnit label displayed after the input value.
value*number | nullControlled numeric value.
isOptionalfalse
isRequired*true
hasClearfalseWhether to show a clear button.
onChange*(value: number) => voidCalled when the numeric value changes.