NumberInput

NumberInput is a component used to obtain numeric input from the user.

Usage

import { NumberInput } from "@yamada-ui/react"
<NumberInput />

Change Variant

Change Size

Set Default Value

To set a default value, set a string or number to defaultValue.

Set Minimum and Maximum Values

To set minimum and maximum values, set a number to min or max.

Set Step Value

To set a step value, set a number to step.

Set Decimal Points

To set decimal points, set a number to precision.

Disable Clamping Value on Blur

By default, the component accepts any numeric input from the user, but values exceeding min or max are automatically adjusted on blur. To disable this automatic adjustment, set clampValueOnBlur to false.

Allow Out-of-Range Values

To allow out-of-range values, set keepWithinRange to false.

Disable

To disable the component, set disabled to true.

Read-Only

To make the component read-only, set readOnly to true.

Invalid

To make invalid, set invalid to true.

Change Border Color

To change the border color, set a color to focusBorderColor or errorBorderColor.

Change Placeholder Color

To change the placeholder color, set _placeholder to the value.

Customize Stepper

To customize the stepper, set props to incrementProps or decrementProps.

Customize Component

To customize the component, use useNumberInput.

Control

Props

Accessibility

Currently, this section is being updated due to the migration of v2.