stepper_documentation.py 1.0 KB

1234567891011121314151617181920212223
  1. from nicegui import ui
  2. from ...model import UiElementDocumentation
  3. class StepperDocumentation(UiElementDocumentation, element=ui.stepper):
  4. def main_demo(self) -> 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')