docs/versioned_docs/version-2.8.0/widgets/text-input.md
Text Input widget lets users enter and edit text.
:::tip The Text Input should be preferred when user input is a single line of text. :::
The default value that the widget will hold when the app is loaded.
It specifies a hint that describes the expected value.
This event fires whenever the user types something on the text input.
This event fires whenever the user presses the enter button on keyboard after entering some text on text input component.
This event fires whenever the user clicks inside the text input component.
This event fires whenever the user clicks outside the text input component.
:::info Check Action Reference docs to get detailed information about all the Actions. :::
Use this field to enter a Regular Expression that will validate the password constraints.
Enter the number for a minimum length of password allowed.
Enter the number for the maximum length of password allowed.
If the condition is true, the validation passes, otherwise returns a string that should be displayed as the error message. For example: {{components.passwordInput1.value === 'something' ? true: 'value should be something'}}.
A Tooltip is often used to specify extra information about something when the user hovers the mouse pointer over the widget.
Under the <b>General</b> accordion, you can set the value in the string format. Now hovering over the widget will display the string as the tooltip.
<div style={{textAlign: 'center'}}> </div>Toggle on or off to display the widget in desktop view. You can programmatically determine the value by clicking on Fx to set the value {{true}} or {{false}}.
Toggle on or off to display the widget in mobile view. You can programmatically determine the value by clicking on Fx to set the value {{true}} or {{false}}.
Use this property to set the color of the text inside the text input component. You can select the color from the color picker or set the value using Hex color code.
Add a color to the border of the text-input component using this property. You can select the color from the color picker or set the value using Hex color code.
Use this property to modify the border radius of the widget. The field expects only numerical values from 1 to 100, and default is 0.
It is to control the visibility of the widget. If {{false}} the widget will not be visible after the app gets deployed. It can only have boolean values i.e. either {{true}} or {{false}}. By default, it's set to {{true}}.
This property only accepts boolean values. If set to {{true}}, the widget will lock and become non-functional. By default, its value is set to {{false}}.
:::info Check the component specific actions available for this component here. :::
| Variables | Description |
|---|---|
| value | This variable holds the value whenever user a user inputs a value in the component. You can access the value dynamically using JS: {{components.textinput1.value}} |
Following actions of text input component can be controlled using the component specific actions(CSA):
| Actions | Description |
|---|---|
| setFocus | Set the focus of the cursor on the text input via a component-specific action within any event handler. Additionally, you have the option to employ a RunJS query to execute component-specific actions such as await components.textinput1.setFocus() |
| setBlur | Removes the focus of the cursor on the text input via a component-specific action within any event handler. Additionally, you have the option to employ a RunJS query to execute component-specific actions such as await components.textinput1.setBlur() |
| disable | disable the component via a component-specific action within any event handler. Additionally, you have the option to employ a RunJS query to execute component-specific actions such as await components.textinput1.disable(true) |
| visibility | Set a visibility of the text input via a component-specific action within any event handler. Additionally, you have the option to employ a RunJS query to execute component-specific actions such as await components.textinput1.visibility(false) |
| setText | Set a text value on the text input component via a component-specific action within any event handler. Additionally, you have the option to employ a RunJS query to execute component-specific actions such as await components.textinput1.setText('this is input text') |
| clear | Clear the entered text from the text input via a component-specific action within any event handler. Additionally, you have the option to employ a RunJS query to execute component-specific actions such as await components.textinput1.clear() |