# st.page_link

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

> **Tip**
>
> Check out our [tutorial](https://docs.streamlit.io/develop/tutorials/multipage/dynamic-navigation) to learn about building dynamic navigation menus with `st.navigation` and `st.page_link`.

* Function signature:

   ```python
   st.page_link(page, *, label=None, icon=None, icon_position="left", help=None, disabled=False, use_container_width=None, width="content", query_params=None)
   ```

* Parameters:

   | name | type | default | description |
   |---|---|---|---|
   | page | str, Path, or Page |  | The page to switch to on user click. This can be one of the following values:  Path to a Python file: The path can be a string or pathlib.Path object. It can be absolute or relative to the entrypoint file. The Python file must be the source of a page in st.navigation. If you are using the pages/ directory instead of st.navigation, the Python file must be your entrypoint file or a file in the pages/ directory.  Page: The source of the Page and its url_path must match a page defined in st.navigation. Use st.Page to create a Page object.  URL: The URL must contain an HTTP or HTTPS scheme, like "https://docs.streamlit.io". When a user clicks a URL-defined page link, the URL opens in a new tab and the app doesn't rerun. If the page link is defined by a URL, then the label parameter is required.   To link to a page defined by a callable, you must use a Page object. |
   | label | str |  | The label for the page link. Labels are required for external pages. The label can optionally contain GitHub-flavored Markdown of the following types: Bold, Italics, Strikethroughs, Inline Code, Links, and Images. Images display like icons, with a max height equal to the font height. Unsupported Markdown elements are unwrapped so only their children (text contents) render. Common block-level Markdown (headings, lists, blockquotes) is automatically escaped and displays as literal text in labels. See the body parameter of st.markdown for additional, supported Markdown directives. |
   | icon | str or None |  | An optional emoji or icon to display next to the link label. If icon is None (default), the icon is inferred from the Page object or no icon is displayed. Pass icon="" to show no icon even when the page has one. If icon is a non-empty string, the following options are valid:  A single-character emoji. For example, you can set icon="🚨" or icon="🔥". Emoji short codes are not supported.  An icon from the Material Symbols library (rounded style) in the format ":material/icon_name:" where "icon_name" is the name of the icon in snake case. For example, icon=":material/thumb_up:" will display the Thumb Up icon. Find additional icons in the Material Symbols  font library.  "spinner": Displays a spinner as an icon. |
   | icon_position | "left" or "right" |  | The position of the icon relative to the link label. This defaults to "left". |
   | help | str or None |  | A tooltip that gets displayed when the link is hovered over. If this is None (default), the tooltip is the help of the linked page when page is a Page object or the path of a page passed to st.navigation. Otherwise, no tooltip is displayed. Pass help="" to show no tooltip even when the page has help. The tooltip can optionally contain GitHub-flavored Markdown, including the Markdown directives described in the body parameter of st.markdown. |
   | disabled | bool | is | An optional boolean that disables the page link if set to True. The default is False. |
   | use_container_width | bool | is | Whether to expand the link's width to fill its parent container. The default is True for page links in the sidebar and False for those in the main app. |
   | width | "content", "stretch", or int |  | The width of the page-link button. This can be one of the following:  "content" (default): The width of the button matches the width of its content, but doesn't exceed the width of the parent container. "stretch": The width of the button matches the width of the parent container. An integer specifying the width in pixels: The button has a fixed width. If the specified width is greater than the width of the parent container, the width of the button matches the width of the parent container. |
   | query_params | dict, list of tuples, or None |  | Query parameters to apply when navigating to the target page. This can be a dictionary or an iterable of key-value tuples. Values can be strings or iterables of strings (for repeated keys). When this is None (default), all non-embed query parameters are cleared during navigation. |
