Creating a Text Area

Creating a text area in zero-true is simple. Type:

import zero_true as zt
text_area=zt.TextArea(id='txt')

Run the cell in your notebook, and watch the text area appear below.

Text Area Settings and Values

Text areas have a range of settings. For example you can add a label to your text area to clarify what you are asking of a user. To access the value they provide you simply use the “value” attribute on the component to access the string they typed:

print("The user just wrote: "+text_area.value)

Text Area Use Cases

Text inputs are useful when you want the user to input long form text. For example in this use case we ask for a user’s feedback. If we only gave them a TextInput they would have limited space to type but with a TextArea you can receive entire paragraphs of feedback:

import zero_true as zt

#feedback area
feedback_area = zt.TextArea(id='txt_a',label= 'Submit you feedback')

This works great for longer texts. For shorter texts we recommend that you use our TextInput component.

Customizing your Text Area

You can also add different colors and labels to your text area to make it to your liking. Feel free to check out the full range of options with the api reference for our text area.