Skip to content

Support query params in st.page_link #8112

@akeeman

Description

@akeeman

Checklist

  • I have searched the existing issues for similar feature requests.
  • I added a descriptive title and summary to this issue.

Summary

Reading an writing query params using st.query_params can be quire useful. It would be handy to support passing query params with st.page_link

Why?

Useful for creating drill down page links, and improves sharing a page's state using the url.

How?

  • introduce a new parameter query_params: dict[str, str | Iterable[str]] to st.page_link to attach query params to the link: st.page_link(page="pages/foo.py", query_params={"my": "params", "go": "here"})
  • and/or allow query params in the page argument: st.page_link(page="pages/foo.py?my=params&go=here")

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:st.page_linkRelated to the `st.page_link` elementstatus:likelyWill probably implement but no timeline yettype:enhancementRequests for feature enhancements or new features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions