Integrate JS components

Hello! I wanted to integrate a JS package into my streamlit app. This one specifically: Zoomooz.js

Could someone offer some guidance as to how to about doing this?

Thank you!

Hi @ryanblumenow -

In general, to incorporate JavaScript packages into Streamlit, they need to be wrapped using the Streamlit Components framework:

https://docs.streamlit.io/en/stable/develop_streamlit_components.html

In the case of that library, I’m not sure it would work…I assume you want the ability to be able to zoom in on any Streamlit widget?

Best,
Randy

Hi @randyzwitch

Yes, that’s right - wanted the ability to zoom into a Streamlit widget and retain the ability to click on the widget or interact with it. It would go a long way to improving the look and feel of my GUI that I have built in Streamlit.

Can you help me to see if we can get this library to work? I would really appreciate it.

This isn’t something that can be done via Streamlit components, it would have to be built into the core library. Streamlit components can only access what’s inside their own iframe sandbox, they can’t change core UI elements.

I can suggest this to our product team, but given this functionality would be pretty involved to add to every widget, I suspect you won’t see this functionality added in the timeframe you need to improve your app.

Best,
Randy