# st.navigation

Source: https://docs.streamlit.io/develop/api-reference/navigation/st.navigation

* Function signature:

   ```python
   st.navigation(pages, *, position="sidebar", expanded=False)
   ```

* Parameters:

   | name | type | default | description |
   |---|---|---|---|
   | pages | Sequence[page-like], Mapping[str, Sequence[page-like]] | title | The available pages for the app. To create a navigation menu with no sections or page groupings, pages must be a list of page-like objects. Page-like objects are anything that can be passed to st.Page or a Page object returned by st.Page. To create labeled sections or page groupings within the navigation menu, pages must be a dictionary. Each key is the label of a section and each value is the list of page-like objects for that section. If you use position="top", each grouping will be a collapsible item in the navigation menu. For top navigation, if you use an empty string as a section header, the pages in that section will be displayed at the beginning of the menu before the collapsible sections. Section labels support GitHub-flavored Markdown as described in the title parameter of st.Page. When you use a string or path as a page-like object, they are internally passed to st.Page and converted to Page objects. In this case, the page will have the default title, icon, and path inferred from its path or filename. To customize these attributes for your page, initialize your page with st.Page. Each page must have a unique URL pathname across all of pages, including pages in different sections, hidden pages, and external URL pages. Because the pathname is inferred from the filename, admin/settings.py and user/settings.py both resolve to settings. Set url_path in st.Page to give one of them a different pathname. |
   | position | "sidebar", "top", or "hidden" |  | The position of the navigation menu. If this is "sidebar" (default), the navigation widget appears at the top of the sidebar. If this is "top", the navigation appears in the top header of the app. If this is "hidden", the navigation widget is not displayed. If there is only one page in pages, the navigation will be hidden for any value of position. |
   | expanded | bool or int |  | Controls whether the navigation menu is expanded and how many items are visible when it's collapsed. This parameter is only used when position="sidebar" and the sidebar has other elements below the navigation menu. If the sidebar only contains the navigation menu, it will always be fully expanded. The following values are valid:  False (default): The navigation menu shows a maximum of ten pages when there are more than twelve pages. The menu is fully expanded when there are twelve or fewer pages. A collapsed menu has a "View X more" button at the bottom. An expanded menu that can be collapsed has a "View less" button at the bottom. True: The navigation menu will always be fully expanded, and no "View less" button will be displayed. Positive integer: A positive integer specifies the maximum number of pages to display when the menu is collapsed. When there are at least three more pages than this integer, the menu will be collapsed. Otherwise, the menu will be fully expanded. expanded=10 is equivalent to the default, expanded=False.  If the value of expanded changes between reruns, an expanded menu will stay expanded. If the change in value makes the menu newly collapsible, Streamlit will only add a "View less" button at the bottom. |

* Returns: Page

    The current page selected by the user. To run the page, you must use
the .run() method on it.
