Welcome to the community and thanks for your question!
To create a multipage Streamlit app in Snowflake’s Snowsight, you’ll use the same core approach as standard Streamlit: a main entrypoint file (like streamlit_app.py) and a pages/ folder containing additional .py files for each page. Snowsight will automatically generate a sidebar navigation for these pages.
Steps:
- In Snowsight, create your main file (e.g.,
streamlit_app.py). This will be your app’s homepage. - Create a
pagesfolder in your app’s file structure. - Add additional Python files (e.g.,
1_Overview.py,2_Topic_Details.py) to thepagesfolder. Each file becomes a separate page in the sidebar. - The sidebar will display page names based on filenames (numbers and underscores are handled automatically).
- To change the main page’s name in the sidebar, create a new file (e.g.,
Home.py), copy your code there, and set it as the entrypoint using theALTER STREAMLITSQL command:
Replacealter streamlit "<APP_IDENTIFIER>" set main_file = 'Home.py';<APP_IDENTIFIER>with your app’s identifier from the URL or by runningshow streamlitsin a worksheet.
For more control over navigation (custom names, icons, or dynamic menus), use st.Page and st.navigation in your entrypoint file. This lets you define pages and their properties programmatically.
Sources: