Maximize custom component


I am creating a custom plotly.js component for Streamlit. So far so good.

I have a question about the possibility to maximize my custom component. Streamlit’s plotlyChart component shows the “View fullscreen” button (see below)


Is it possible to add the same functionality to a custom component? I haven’t found anything useful in neither the documentation nor the componenet-lib.

Can this be done?



Hi @robotj

The st.plotly_chart method has the use_container_width parameter that when set to True can occupy the page’s width.

The components also has parameters for adjusting the width and height as well as it’s embedded inside an iframe.

Hope this helps.

you use simple CSS for this the hope the example below helps

            .fullHeight {height : 80vh;
                  width : 100%}
            </style>''', unsafe_allow_html = True)

container = st.container()

container.markdown("<iframe scr='linke', class = 'fullHeight'></iframe>", unsafe_allow_html = True)

Thanks for the answer, however this was not exactly what I was looking for.

I wanted to set the same behavior other Streamlit componenets already offer without the need to implement maximization myself, which would not be trivial.

Well, this does set the component to be fullscreen by default. This is not exactly what I wanted.
Thank you anyway!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.