Deep linking lets someone copy a URL that reopens an application at a specific resource, view, or state. For a dashboard, it replaces screenshots and error-prone instructions with a shareable link that preserves selections such as dates, filters, and chart settings. section 7.6
Sharing a dashboard view
A URL such as https://duckduckgo.com/?t=h_&q=streamlit&ia=web embeds the search input q=streamlit. A Streamlit dashboard applies the same idea: store widget values in URL query parameters, then restore those values when another user opens the link. section 7.6
Implement deep linking in two directions:
- Read query parameters and use them to populate widget values during the initial app load. section 7.6 section 7.6.3
- Write changed widget values back to the URL so the current dashboard state remains shareable. section 7.6.3
- Give shareable widgets keys beginning with w:, separating URL-controlled values from other session-state entries. section 7.6.3
- Restore defaults only when a key is absent from session state; otherwise, reruns would overwrite user changes. section 7.6.3
- Serialize values deliberately: encode lists with L# and dates with D#, then decode them when reading the URL. section 7.6.3
