stepper_documentation.py 910 B

12345678910111213141516171819202122232425
  1. from nicegui import ui
  2. from . import doc
  3. @doc.demo(ui.stepper)
  4. def main_demo() -> None:
  5. with ui.stepper().props('vertical').classes('w-full') as stepper:
  6. with ui.step('Preheat'):
  7. ui.label('Preheat the oven to 350 degrees')
  8. with ui.stepper_navigation():
  9. ui.button('Next', on_click=stepper.next)
  10. with ui.step('Ingredients'):
  11. ui.label('Mix the ingredients')
  12. with ui.stepper_navigation():
  13. ui.button('Next', on_click=stepper.next)
  14. ui.button('Back', on_click=stepper.previous).props('flat')
  15. with ui.step('Bake'):
  16. ui.label('Bake for 20 minutes')
  17. with ui.stepper_navigation():
  18. ui.button('Done', on_click=lambda: ui.notify('Yay!', type='positive'))
  19. ui.button('Back', on_click=stepper.previous).props('flat')
  20. doc.reference(ui.stepper)