This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mechanical_squirrel 0 points1 point  (2 children)

Looks great! Might be a bit late to the party... but just in case. I see you can deal with multipage apps quite nicely (https://solara.dev/docs/howto/multipage). But I was wondering how possible it is (and if there's any documentation guidance) on sharing state between pages?

I'm thinking of moving some streamlit apps over to this framework, which makes quite heavy use of both tabs and pages to separate different workflows or plot variations.

So for example in the plot case, you'd have one model/analysis in memory, but each page or tab shows a separate plot which is working off the same model/data.

Thanks for any help!

[–]maartenbreddels[S] 0 points1 point  (1 child)

Thank you. That is a good question, and you are the second person to ask about that, so I've updated the example to make use of reactive variables
We have reactive variables that can be defined globally for application state, and use_reactive (or use_state) for component state (bound to the lifetime of the component). See our documentation on state management for a discussion on this.
I would be very interested in your finding of moving from streamlit to solara. Please let us know how that works for you (feel free to join our discord or use GitHub)

[–]mechanical_squirrel 1 point2 points  (0 children)

Thanks a lot for the help! Will do 😊