Can you check to see if you have the latest version of st_pages installed? You can see that code working fine here https://st-pages-sections.streamlit.app/
Very cool!!!
Hey @blackary, I have built a streamlit app (in version 1.11.1) where all pages are defined in the pages folder in a particular order. I wish to hide all pages before user logs into the app and was tryingt he follow the approach youâve mentioned above.
Iâm tried to import different modules from st_pages as suggested above, but Iâm getting an error that says: cannot import name âruntimeâ from âstreamlitâ. What shall I try next?
The best solution will probably be to upgrade to a more recent version of streamlit
Yeah it works after upgrading the library, thanks!
i managed to get it working finally! i decided to use the pages.toml file.
a few remarks though:
- You cant leave the icon field behind, if you dont want to use it, you have to specify that its empty:
wrong:
[[pages]]
path = âscript.pyâ
name = âPage Nameâ
correct:
[[pages]]
path = âscript.pyâ
name = âPage Nameâ
icon = ââ
- Some of the emojis inside the icon string wont be recognized and giving an error, i decided to place all emojis and icos inside the page name.
correct:
[[pages]]
path = âscript.pyâ
name = âPage Nameâ
icon = ââ
Hi @Christian, thanks for the feedback.
You shouldnât need to add an empty icon â you can see an example here that doesnât specify an icon, and it works fine https://github.com/blackary/st_pages/blob/main/example_app/.streamlit/pages.toml#L21
What do you mean by icons âwonât be recognizedâ? Can you give an example of one that isnât recognized?