An all-in-one place, to find complex or just natively unavailable components on streamlit.
Project description
Extra-Streamlit-Components
An all-in-one place, to find complex or just not available components by default on streamlit.
Components
Firstly, add import extra_streamlit_components as stx
-
Cookie Manager
The long awaited between-sessions in-browser cookies store and manager! It stores cookies in a strict same-site behaviour.
To add an expiry date to a cookie use the
expires_at
parameter in the set function. By default, it will expire after 1 day.P.S. For best experience use streamlit>=0.84.0
import datetime cookie_manager = stx.CookieManager() st.subheader("All Cookies:") cookies = cookie_manager.get_all() st.write(cookies) c1, c2, c3 = st.beta_columns(3) with c1: st.subheader("Get Cookie:") cookie = st.text_input("Cookie", key="0") clicked = st.button("Get") if clicked: value = cookie_manager.get(cookie) st.write(value) with c2: st.subheader("Set Cookie:") cookie = st.text_input("Cookie", key="1") val = st.text_input("Value") if st.button("Add"): cookie_manager.set(cookie, val, expires_at=datetime.datetime(year=2022, month=2, day=2)) with c3: st.subheader("Delete Cookie:") cookie = st.text_input("Cookie", key="2") if st.button("Delete"): cookie_manager.delete(cookie)
-
TabBar
Inspire from React's
ScrollMenu
, this component receives a list ofTabBarItemData
, and returns theid
of the selected tabchosen_id = stx.tab_bar(data=[ stx.TabBarItemData(id=1, title="ToDo", description="Tasks to take care of"), stx.TabBarItemData(id=2, title="Done", description="Tasks taken care of"), stx.TabBarItemData(id=3, title="Overdue", description="Tasks missed out"), ], default=1) st.info(f"{chosen_id=}")
-
BouncingImage
Probably not the best naming but this component, renders an image by its path or url, and animates by zooming in and out repetitively giving an illusion of a bounce.
image_url = "https://streamlit.io/images/brand/streamlit-logo-secondary-colormark-darktext.svg" stx.bouncing_image(image_source=image_url, animate=True, animation_time=1500, height=200, width=600)
-
StepperBar
A streamlit wrapper on MaterialUI's Stepper
val = stx.stepper_bar(steps=["Ready", "Get Set", "Go"]) st.info(f"Phase #{val}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for extra_streamlit_components-0.1.44.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d75f2a72cbcf5c9860926187e7c7e05a7b553be16c38be390e14b8c7572b1f69 |
|
MD5 | f7b643cc627af2fd74c820a3566b17c0 |
|
BLAKE2b-256 | 8e3ba7113b0f0ac29c7fea4ce57e2cdd05810d61e5edade031d9bb8ba16bc88a |
Hashes for extra_streamlit_components-0.1.44-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2837877a0774b6ee42855661a3ec757c79b05b72667bca0d72af92a8524ef93d |
|
MD5 | 37df4b822d78976b785874e4a2bfd774 |
|
BLAKE2b-256 | 04b9fcb48cfcbc64d38d545294e5443dfa4b51ac5c036aec7686588a21006a8a |