solara.InputText(label="New todo", value=text, on_value_change=text.set) solara.Button("Add", on_click=add_todo) @solara.component def TodoList(): def toggle(index): new_todos = todos.value.copy() new_todos[index]["done"] = not new_todos[index]["done"] todos.value = new_todos
Here’s an informative overview of on GitHub. What is Solara? Solara is a pure Python, React-style web framework for building scalable and interactive web apps, specifically designed for data scientists and Python developers. It is built on top of React and FastAPI , but you don't need to know any JavaScript or HTML to use it. github solara
def add_todo(): if text.value.strip(): todos.value = todos.value + ["text": text.value, "done": False] text.value = "" solara
@solara.component def Counter(): def increment(): count.value += 1 github solara
@solara.component def TodoInput(): text = solara.reactive("")