You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated Get started > Fundamentals > Additional features to reflect MPAv2 (#1234)
* Udated 'Get Started / Fundamentals / Additional features' to use MPA v2
* Added links to st.Page and st.navigation in additional-features.md
* Fix URLs so they don't point to localhost ;)
---------
Co-authored-by: Thiago Teixeira <103002884+sfc-gh-tteixeira@users.noreply.github.com>
Copy file name to clipboardExpand all lines: content/get-started/fundamentals/additional-features.md
+29-10Lines changed: 29 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,30 +50,49 @@ your config.toml file, and watch as your app reruns with the new theme colors ap
50
50
51
51
## Pages
52
52
53
-
As apps grow large, it becomes useful to organize them into multiple pages. This makes the app easier to manage as a developer and easier to navigate as a user. Streamlit provides a frictionless way to create multipage apps.
53
+
As apps grow large, it becomes useful to organize them into multiple pages. This makes the app easier to manage as a developer and easier to navigate as a user. Streamlit provides a powerful way to create multipage apps using [`st.Page`](/develop/api-reference/navigation/st.page) and [`st.navigation`](/develop/api-reference/navigation/st.navigation). Just create your pages and connect them with navigation as follows:
54
54
55
-
We designed this feature so that building a multipage app is as easy as building a single-page app! Just add more pages to an existing app as follows:
55
+
1. Create an entry point script that defines and connects your pages
56
+
2. Create separate Python files for each page's content
57
+
3. Use [`st.Page`](/develop/api-reference/navigation/st.page) to define your pages and [`st.navigation`](/develop/api-reference/navigation/st.navigation) to connect them
56
58
57
-
1. In the folder containing your main script, create a new `pages` folder. Let’s say your main script is named `main_page.py`.
58
-
2. Add new `.py` files in the `pages` folder to add more pages to your app.
59
-
3. Run `streamlit run main_page.py` as usual.
59
+
Here's an example of a three-page app:
60
60
61
-
That’s it! The `main_page.py` script will now correspond to the main page of your app. And you’ll see the other scripts from the `pages` folder in the sidebar page selector. The pages are listed according to filename (without file extensions and disregarding underscores). For example:
Now run `streamlit run main_page.py` and view your shiny new multipage app!
119
+
Now run `streamlit run streamlit_app.py` and view your shiny new multipage app! The navigation menu will automatically appear, allowing users to switch between pages.
101
120
102
-
<Imagesrc="/images/mpa-main-concepts.gif" />
121
+
<Imagesrc="/images/mpa-v2-main-concepts.gif" />
103
122
104
123
Our documentation on [Multipage apps](/develop/concepts/multipage-apps) teaches you how to add pages to your app, including how to define pages, structure and run multipage apps, and navigate between pages. Once you understand the basics, [create your first multipage app](/get-started/tutorials/create-a-multipage-app)!
0 commit comments