1
0

button_documentation.py 541 B

123456789101112131415161718
  1. from nicegui import ui
  2. from ..documentation_tools import text_demo
  3. def main_demo() -> None:
  4. ui.button('Click me!', on_click=lambda: ui.notify(f'You clicked me!'))
  5. def more() -> None:
  6. @text_demo('Await button click', '''
  7. Sometimes it is convenient to wait for a button click before continuing the execution.
  8. ''')
  9. async def await_button_click() -> None:
  10. # @ui.page('/')
  11. # async def index():
  12. await ui.button('What comes next?').clicked()
  13. ui.label('Bam! This is the future!')