Input box
Introduction
The input box is a common component in forms. It allows users to enter content into a form field.

Configurations
Category |
Configuration |
Example |
Description |
Content |
Default value |
|
The default value of the component. |
Placeholder content |
|
The placeholder content. |
|
Maximum length |
|
The maximum number of characters allowed. |
|
Password mode |
|
Specifies whether to enable password mode. |
|
Label |
|
The form label. For more information, see General form properties. |
|
Extension configuration |
|
Settings for component prefixes and suffixes, such as text and icons. |
|
Interaction |
Hide |
|
Hides the component. For more information, see General properties. |
Disable |
|
Disables the component. A disabled component cannot be clicked or selected. |
|
Search |
|
Specifies whether to display the search button. |
|
Validation |
|
Form validation. For more information, see General form properties. |
|
Style |
Margin |
|
The outer margin. For more information, see General properties. |
Clear button |
|
Specifies whether to display the clear button. |
|
Style variant |
|
The style variants of the component. Different variants support 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 the active state. |
|
Active border color |
|
The border color of the component in the active state. |
|
Active shadow |
|
The shadow of the component in the active state. |
|
Hover background color |
|
The background color of the component in the hover state. |
|
Hover border color |
|
The border color of the component in the hover state. |
|
Prefix/suffix text background color |
|
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 |
|
Specifies whether the component is disabled. |
maxLength |
number |
|
Placeholder content |
isPassword |
boolean |
|
Specifies whether the component is in password mode. |
placeholder |
string |
|
The hint text displayed when the content is empty. |
addonBefore |
string |
|
The prefix text inside the component. |
addonAfter |
string |
|
The suffix text inside the component. |
showSearch |
boolean |
|
Show Search |
hidden |
boolean |
|
Specifies whether the component is hidden. |
validationStatus |
boolean |
|
The validation status of the component. |
validationMessage |
string |
|
The validation message of the component. |
blur |
func |
|
Removes focus from the component. |
focus |
func |
|
The component receives 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 state of the component. |
Event callbacks
Configuration |
Description |
|
The event triggered after the component's value changes. |
|
The event triggered after the component gains focus. |
|
The event triggered after the component loses focus. |
|
The event triggered after the Enter key is pressed within the component. |
Scenario examples
Logon scenario
Configuration: Disable Password mode for the username and enable it for the password. Use Placeholder content to distinguish between the two fields.
This configuration creates a standard logon form with a username and password.
Form validation
Configuration: Drag a Form component onto the canvas, and then drag three input boxes into the form. For the first input box, enter "Mobile number" as the Label content. To add validation, click the icon on the right, add a Custom item, and then enter the regular expression as shown in the figure.
This configuration lets you validate input fields within the form.






























