Py.Cafe

maartenbreddels/

solara-state-state-multipage

Use state on multiple pages

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# check out https://solara.dev/ for documentation
# or https://github.com/widgetti/solara/
# And check out https://py.cafe/maartenbreddels for more examples
import solara
import page1
import page2
# reactive variables will trigger a component rerender
# when changed.
# When you change the default (now 0), hit the embedded browser
# refresh button to reset the state
clicks = solara.reactive(0)

title = "lala"

routes = [
    solara.Route("/", component=page1.Page),
    solara.Route("other", component=page2.Page),
]

state.py
1
Could not load content
page1.py
1
Could not load content
page2.py
1
Could not load content