
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import solara
clicks = solara.reactive(0)
@solara.component
def Page():
print("The component render function gets called")
solara.Style("button.css")
# change this code, and see the output refresh
color = "green"
if clicks.value >= 5:
color = "red"
def increment():
clicks.value += 1
print("clicks", clicks) # noqa
solara.Button(label=f"Clicked: {clicks}", on_click=increment, color=color, disabled=clicks.value >= 0)
1
Could not load content