
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import solara
clicks = solara.reactive(0)
@solara.component
def Page():
color = "green"
if clicks.value >= 5:
color = "red"
def increment():
clicks.value += 1
print("clicks", clicks) # noqa
solara.Button(label=f"Ploomber: {clicks}", on_click=increment, color=color)
1
2
numpy