notify_documentation.py 620 B

1234567891011121314151617
  1. from nicegui import ui
  2. from ..documentation_tools import text_demo
  3. def main_demo() -> None:
  4. ui.button('Say hi!', on_click=lambda: ui.notify('Hi!', close_button='OK'))
  5. def more() -> None:
  6. @text_demo('Notification Types', '''
  7. There are different types that can be used to indicate the nature of the notification.
  8. ''')
  9. def notify_colors():
  10. ui.button('negative', on_click=lambda: ui.notify('error', type='negative'))
  11. ui.button('positive', on_click=lambda: ui.notify('success', type='positive'))
  12. ui.button('warning', on_click=lambda: ui.notify('warning', type='warning'))