Basic usage
Constructor
Default text to display. If a function is provided, it will be called each time the app loads
Input type:
"text"- Standard text input"password"- Masked password input"email"- Email input with validation
lines must be 1Minimum number of visible lines
Maximum number of visible lines. If None, defaults to
max(lines, 20) for text typePlaceholder hint text
Label displayed above the component
Additional info text below the label. Supports markdown/HTML
Whether to display the label
Whether the textbox is editable. Inferred automatically if not provided
Whether the component is visible
Whether to focus on the textbox when the page loads
Whether to automatically scroll to bottom when value changes
Text alignment. Only works with
type="text"Whether to render text right-to-left. Only works with
type="text"Maximum character length (including newlines)
True- Show submit button with iconstr- Show submit button with custom textFalse- Hide submit button
True- Show stop button with iconstr- Show stop button with custom textFalse- Hide stop button
List of buttons to show. Options:
"copy"- Copy text to clipboard- Custom
gr.Button()instances
Events
The Textbox component supports the following events:- change - Triggered when value changes
- input - Triggered on every keystroke
- select - Triggered when text is selected
- submit - Triggered when Enter is pressed
- focus - Triggered when component gains focus
- blur - Triggered when component loses focus
- stop - Triggered when stop button is clicked
- copy - Triggered when text is copied