Number input
Introduction
The number input is a common form component. You can use it to obtain a standard numerical value.

Configuration items
Category |
Configuration |
Example |
Description |
Content |
Default value |
The default value of the component. |
|
Placeholder content |
The placeholder content. |
||
Maximum value |
The maximum value allowed for input. |
||
Minimum value |
The minimum value allowed for input. |
||
Step size |
The amount to change the value by each step. This can be a decimal. |
||
Label |
The form label. For more information, see General form properties. |
||
Extension configuration |
The prefix text, suffix text, prefix icon, decimal point (custom decimal point), and numerical precision (number of decimal places to display) for the component. |
||
Interaction |
Hidden |
Hides the component. For more information, see General properties. |
|
Disabled |
Disables the component. A disabled component cannot be clicked or selected. |
||
Validation |
Form validation. For more information, see General form properties. |
||
Style |
Margin |
The outer margin. For more information, see General properties. |
|
Variants |
The different style variants of the input box. Different variants have different CSS styles. |
||
CSS style |
Border radius |
The border radius of the component. |
|
Font size |
The font size of the component. |
||
Background color |
The background color of the component. |
||
Border color |
The border color of the component. |
||
Active background color |
The background color of the component in its active state. |
||
Active border color |
The border color of the component in its active state. |
||
Active shadow |
|
The shadow of the component in its active state. |
|
Hover background color |
The background color of the component in its hover state. |
||
Hover border color |
The border color of the component in its hover state. |
||
Background color for prefix and suffix text |
The background color for the prefix and suffix text of the component. |
||
Label font size |
The font size of the component label. |
Properties and methods
Name |
Type |
Example |
Description |
value |
string |
|
The current input content. |
labelText |
string |
|
The label text. |
disabled |
boolean |
|
Indicates if the component is disabled. |
max |
number |
|
The maximum number limit for the component. |
min |
number |
|
The minimum number limit for the component. |
placeholder |
string |
|
The placeholder content. |
addonBefore |
string |
|
The prefix text inside the component. |
addonAfter |
string |
|
The suffix text inside the component. |
hidden |
boolean |
|
Indicates if the component is hidden. |
validationStatus |
boolean |
|
The status after validation. |
validationMessage |
string |
|
The message after validation. |
blur |
func |
|
Removes focus from the component. |
focus |
func |
|
The component gains focus. |
validate |
func |
|
Validates the component. |
setValue |
func |
|
Sets the content of the component. |
setDisabled |
func |
|
Sets the disabled state of the component. |
setHidden |
func |
|
Sets the hidden state of the component. |
clearValue |
func |
|
Clears the value of the component. |
clearHidden |
func |
|
Clears the hidden value of the component. |
clearValidate |
func |
|
Clears the validation message of the component. |
Event callbacks
Configuration |
Description |
The event that triggers after the component's value changes. |
|
The event that triggers after the component gains focus. |
|
The event that triggers after the component loses focus. |
Scenario examples
Form scenario
Configuration: Set Maximum value to 100 and Minimum value to 1.
With this configuration, the number input only accepts numbers from 1 to 100.
