What are the toughest, hackiest workflows you’re trying to build into your Streamlit apps today?
We want to try and transform these frustrating workflows into fully supported API’s. Please tell me about them in the comments below, so we can begin to address what’s possible in the roadmap.
Authentication. It would be nice to have the big authentication providers (Google, Microsoft) to provide login to my Streamlit app and keep the user session across page reloads. Currently I am authenticating my users with login/password but the users complain on having to input login/password every time.
Tailwind-like CSS. Currently the most hacky thing I do is inject custom CSS in my app through st.write() with unsafe_allow_html=True. But that has a lot of downsides, as the class of the elements I am assigning CSS to change over time and it’s really not very practical to have the CSS style in a file other than the file where my element is. As a React/Next.js developer, tailwind is the kind of technology that would be perfect for Streamlit, as every visual element could have a set of associated Tailwind utility style classes for an unlimited amount of customization.
Set query params. Recently Streamlit introduced reading from query params, but setting them would also be awesome so users could share specific app state with other users. Would also be nice to have a validation to reading from query params like React has with Zod, or maybe some documentation, if Python has validation built in with Pydantic or something.
Reactive pydeck/deck.gl chart. Everytime the data changes on my pydeck chart, the chart has to be completely regenerated. It would be nice to have a reactive wrapper that could stream the new data in the existing chart like what can be done using deck.gl, the native JavaScript library, and React.
A better multi-select. Currently I am using third party components like StreamlitAntdComponents and streamlit-sortables for multiselect as the built in multiselect doesn’t allow sorting and is a little messy to select a lot of options.
Next.js-like page prefetching. It would be nice to have a Next.js like page pre-fetching to increase the apparent performance of the web Streamlit app while navigating it.
Hacking the original HTML templates for style, javascript, and html changes. Pretty easy to do though once you figure it out. An easier way to template that though would be nice.
Would be nice if I could custom load less default javascript… just the parts I need to speed up loading.
Cookies and local storage (javascript in general) would be great too. So I do not have to hacky things to get the text input to start with the web focus or to make a nice button menu.
Oh, and packaging into smaller Docker images / containers is hard with some of the dependencies (Apache Arrow I think is one)
The requests for Auth and cookies (and maybe even local storage??) are definitely on the roadmap and some of the next big things we want to tackle, stay tuned as I hope to post an update soon about that…
By the way @DarkCSS, setting query params is already supported today! you can do st.query_params["foo"] = "baz" and it will add ?foo=baz to your app URL.
Feedback definitely heard on the CSS and JS improvements. We actually had a recent conversation with some folks who work on deck.gl about possible improvements and better integration there but I’m not sure about the timing. Agreed that would be awesome!
Taking notes on the other requests and +1s, and would love to hear more from other folks too! Thanks everyone!
User session management (authentication, number of sessions, session lenght). I have even posted about it, but it did not gain much traction I guess it is a problem mainly in corporate production enviroment.
I agree that authentication is something really awaited.
Also when I talk to other people interested in Streamlit they ask how I manage authentication since there is not a straight way to do it.
A more stable way to inject CSS and customize elements.
I use pydeck too and I would like to have the same interactivity we have with streamlit-folium, since it’s much more powerful
Hi there, greetings!
Don’t know what can be added or what is still there but I don’t see! But these are some issues which I found in my work so mentioning them here.
Dedicated authentication mechanism
Smooth multipage experience-opening pages in the same window or in a new window without losing states.
Is there any option to run code for tabs only when they are clicked? So that I can save run time for my apps.
Better experience with related process like button click → mutliple container opens (has buttons again) → clicking button here does some action. But I looose my containers, which were opened with the first button. I tried to do something with the recent fragment release, but there are issues with st.form_submit_required as it removes the forms when I click on the button inside a fragment function.
Options to integrate other widgets like st.buttons, st.audio on dataframe columns if I have some data on a row I will click the button just present in other column to open a new tab or do something else.
Can we have a component which displays limited amount of data on the container and shows next option(when limit reached) to show next(lets say 50 records/containers) data in the same conatainer without running the app again.
For point 1, I am using AWS Cognito with social login from Google and Facebook as IDP for my multi-page app and it seems to keep the cookies and session without having to requiring to login except upon expiry of the cookie (I think).
Also one of the basic things, and important to add is the List views of different elements. So that i can create something like function of container() that will be used as item for showing in the list.
The way i’m using authentication creates a cookie that persists n days (can be changed). That way, once the user logs in, streamlit reads the cookie and displays the username on every page… only if thhe session ends or the cookie expires they need to re-login
Here’s a snippet:
def main():
import streamlit_authenticator as stauth
import yaml
from yaml.loader import SafeLoader
with open('/app/.streamlit/config.yaml') as file:
config = yaml.load(file, Loader=SafeLoader)
authenticator = stauth.Authenticate(
config['credentials'],
config['cookie']['name'],
config['cookie']['key'],
config['cookie']['expiry_days'],
config['preauthorized']
)
name, authentication_status, username = authenticator.login('main', 'sidebar')
if authentication_status:
authenticator.logout('Logout', 'main')
st.write(f'Welcome *{name}*')
… (rest of the code)…
elif authentication_status is False:
st.error('Username/password is incorrect')
elif authentication_status is None:
st.warning('Please enter your username and password')
I’m using this workaround to use streamlit behind an oauth-proxy server (which logs my users in to Google): How to extract headers in streamlit app - #16 by zoltan-spire Adding an official request headers API seems like an easy win (for potentially other use cases too), that would make my authentication workflow a breeze.
I would love to see this officially supported as an API. I use it currently to get header and cookie information which I then use for authentication on my streamlit apps deployed on my companies network. I have found that it works really well but am worried it could be removed without notice. Seems to be the best way to get cookie information consistently, even better than custom components, which can often be a little buggy.
from streamlit.web.server.websocket_headers import _get_websocket_headers
headers = _get_websocket_headers()
To create tables like the one in the image, with row grouping / nested tables, footer and colors I use Datatables. I generate the HTML using Jinja to pass it to streamlit.components.v1.html().
There are also issues about pivot tables and, if possible, it would be nice to see these features for tables conveniently natively.
Thank you for asking this question and thank you so much for all of your work on streamlit. I’ve been really impressed with it in my usage over the last 6 months.
+1 Authentication - I’m using oauth + google workspace, which works great but it was quite a bit of work to setup and I’m using _get_websocket_headers to get headers.
+1 CSS injection - I’d like to be able to put classes on objects and then style those classes
I’d also like to be able to include my own style sheet that would cascade on top of yours. If I redefined a class, it would use my class definition not yours. THat would allow me, e.g., to change the default fonts, colors, etc… That would require you to shift to classes rather than inline css, so probably a big shift.
It would also be great if you adopted a framework like bootstrap. That would make the idea of adding in classes that much more powerful.
I haven’t even tried yet, bit would be awesome if there were a “bookmark” feature which automatically saved the state of the current page into a URL and that reloaded the state when you went to that URL. I know that we can do this on our own with query_params, but that requires a bit of work on our part. It would be nice if that were magic.
Hi Michael,
I’ve been trying to find an easy to implement Auth solution too. +1
For the CSS, I push my solutions out as Docker images and as part of the Docker build I overwrite the base HTML template of streamlit. That seems faster then loading HTML through Streamlit st.html.
For the bookmark, I found cookies to work really well. It is fast and passed with each HTML call so you can save information (just not much… I think it is 4K). Browser storage was nice too but it definitely felt slower. I think there is a Streamlit component that helps with that… integrated would be better : ) If you wanted to preload a page with values from a URL though, obviously you’d need something else.
I use the query string for some small values and did not find it too hard. I was concerned with hackers trying to overload my server by pushing their own info into my code. Needs a bit of cleaning to be sure you only process what you expect to get.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.