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
You can check the code on streamlit-pandas-profiling/ProfileReport.tsx at main · okld/streamlit-pandas-profiling (github.com)
Fanilo