An update to Streamlit-Permalink. Sync widgets with query params

Hi everyone,

Thought I would share another project that I’ve been getting a lot of use out of: GitHub - pgarrett-scripps/streamlit-permalink: Stateful Streamlit Widgets. Widget URL value synchronization.

It synchronizes streamlit widgets with url query params, so that all widgets are stateful. This means that you can share the url from your streamlit app with other, and they will load the same widget values that you see.

Install:

pip install streamlit-permalink-pg

Basic usage:

import streamlit_permalink as stp

# Using key parameter makes the widget URL-aware
text1 = stp.text_input('Type some text', url_key='secret')
# If the user typed 'foobar' into the above text field, the
# URL would end with '?secret=foobar' at this point.

Supported widgets:

  • stp.checkbox
  • stp.radio
  • stp.selectbox
  • stp.multiselect
  • stp.slider
  • stp.select_slider
  • stp.text_input
  • stp.number_input
  • stp.text_area
  • stp.date_input
  • stp.time_input
  • stp.color_picker
  • stp.form_submit_button
  • stp.pills
  • stp.segmented_control
  • stp.toggle
  • stp.data_editor

Its a fork of GitHub - franekp/streamlit-permalink, but has a ton of new features, like url compression, support for streamlit 1.45 and more. Check it out. Some of the updates have been applied to franekp’s repo, but many of the more recent and any future changes will likely remain separate.

1 Like

Added readthedocs and some interactive demo/docs apps.