textarea_documentation.py 571 B

12345678910111213141516171819
  1. from nicegui import ui
  2. from ..documentation_tools import text_demo
  3. def main_demo() -> None:
  4. ui.textarea(label='Text', placeholder='start typing',
  5. on_change=lambda e: result.set_text('you typed: ' + e.value))
  6. result = ui.label()
  7. def more() -> None:
  8. @text_demo('Clearable', '''
  9. The `clearable` prop from [Quasar](https://quasar.dev/) adds a button to the input that clears the text.
  10. ''')
  11. async def clearable():
  12. i = ui.textarea(value='some text').props('clearable')
  13. ui.label().bind_text_from(i, 'value')