HTML/ CSS/ Javascript use with streamlit

You can inject HTML, CSS & JavaScript through multiple methods, most commonly the st.markdown():

st.markdown("""
   some streamlit class name {
     background: red;
  }
""", unsafe_allow_html=True)

You can do the same with javascript if you can get the classes names etc or inject it within an HTML component, for this I redirect you to this question I just answerd where you can find how to add whole HTML comonents or just iframes:

And here’s a demo app for that:

https://shinosuke-lab-2.streamlit.app/

1 Like