import panel as pn
pn.extension()
The TextInput
allows entering any string using a text input box.
For more information about listening to widget events and laying out widgets refer to the widgets user guide. Alternatively you can learn how to build GUIs by declaring parameters independently of any specific widgets in the param user guide. To express interactivity entirely using Javascript without the need for a Python server take a look at the links user guide.
For layout and styling related parameters see the customization user guide.
value
(str): The current value updated when pressing value_input
(str): The current value updated on every key press.disabled
(boolean): Whether the widget is editablemax_length
(int): Max character length of the input field. Defaults to 5000name
(str): The title of the widgetplaceholder
(str): A placeholder string displayed when no value is enteredtext_input = pn.widgets.TextInput(name='Text Input', placeholder='Enter a string here...')
text_input
TextInput.value
returns a string type that can be read out and set like other widgets:
text_input.value
The TextInput
widget exposes a number of options which can be changed from both Python and Javascript. Try out the effect of these parameters interactively:
pn.Row(text_input.controls(jslink=True), text_input)