Skip to content

Instantly share code, notes, and snippets.

@bulletmark
Created November 17, 2025 11:52
Show Gist options
  • Select an option

  • Save bulletmark/03b2ce4f41f3b211e96589631c476f33 to your computer and use it in GitHub Desktop.

Select an option

Save bulletmark/03b2ce4f41f3b211e96589631c476f33 to your computer and use it in GitHub Desktop.
from nicegui import ui
def add_task():
if task := input_field.value.strip():
with list_ui:
ui.item(task)
input_field.value = '' # clear input
with ui.column(): # stack vertically
ui.label('📝 My To-Do List (via Python!)')
input_field = ui.input('Enter a task')
ui.button('Add Task', on_click=add_task)
list_ui = ui.list()
ui.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment