UI
text_input
The text_input
function adds an interactive text box to capture user input in your app. It maintains state between reruns, making it perfect for forms and interactive applications.
Parameters
label
(str): The label displayed next to the text input, indicating its purpose. Also used to generate a consistent ID for state management.placeholder
(str): (Optional) Placeholder text shown when the input is empty. Helps guide users on what to enter.size
(float): (Optional) The width of the component in a row. Defaults to1.0
(full row). See the Layout Guide for details.
Returns
str
: The current value of the text input. Empty string if no input has been provided.
Usage Example
Here’s an example of how to use text inputs in your app:
Key Features
- Customizable Label: Set the label to distinguish between different
text_input
s. - Adjustable Placeholder: Control the look of the textboxes for better UI/UX.
Why Use text_input
?
Text Inputs provide a way to create get end-user text input in the data app.
Was this page helpful?