Is it possible to add a fixed sticky header like sidebar to streamlit?

Hello @xzrokeman, welcome to the forums :speech_balloon:

I think the JS part of your HTML code shouldnโ€™t work, because st.write(string, unsafe_allow_html=True) fallbacks on st.markdown(string, unsafe_allow_html=True) which removes any JS tag from the app (you can actually write code that breaks in the JS tag to validate this). You can also see the script have disappeared in the page source on the web browser.

Anyway the sticky should work without the JS :slight_smile:

Can you reference your issue in Are you using HTML in Markdown? Tell us why! ? Thatโ€™s a good example on how to use HTML/CSS to sticky a header !

1 Like