from framework import For, button, computed, div, signal
tasks = signal((("Ship landing page", True),
("Test the PWA", False),
("Write the guide", False)))
filter_by = signal("All")
visible = computed(lambda: tuple(
task for task in tasks()
if filter_by() == "All" or task[1] == (filter_by() == "Done")
))
def TaskList():
return div(
For(visible, key=lambda task: task[0], render=lambda task:
button("✓" if task[1] else "○", task[0])),
div(lambda: f"{len(visible())} tasks shown"),
)Live framework output
Today