stepper_documentation.py 856 B

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