We’re not artificially limiting the height of the iframe, 150px just happens to be the default size for the argument. I don’t remember the exact reason why width is automatically set but height is not, but it has something to do with the fact that custom components are rendered inside of an iframe.
So when developing, if you see that the height isn’t sufficient, you can pass your own height. In the case where the Python object you are displaying has its own height/width parameters, you can do something like this to automatically set the values:
As a workaround for a custom component (not for components.html unfortunately), I think@okld does it in the pandas-profiling custom component Pandas Profiling , takes the Pandas Profiling auto-generated HTML and immediately displays it
It looks like you have to remove the autosize line and replace it with lines for the height and width parameters.
The example below (which you can adapt to your example) uses f-strings to embed the height and width within the string containing TradingView’s HTML. Note: you need to escape the existing curly braces in the HTML with additional curly braces:
Thank you so much. It solves my issue. Thanks so much for your support.
I think Streamlit is the beautiful thing and makes so much things easier to implement complex things in easier way… Thanks to all for their work… Loving it …
I have a related question to iframe.
when I try to use the iframe and use some generic site to display I am getting error that connection refused. I guess something to do with CORs , but do we have option to get rid of that ? or tradinview.com in my case…