st.iframe
Embed content in an iframe.
st.iframe embeds external URLs, HTML content, or local files in an iframe. It auto-detects the input type and handles it appropriately.
| Function signature[source] | |
|---|---|
st.iframe(src, *, width="stretch", height="content", tab_index=None) | |
| Parameters | |
src (str or Path) | The content to embed. This can be one of the following:
|
width (int, "stretch", or "content") | The width of the iframe. This can be one of the following:
|
height (int, "stretch", or "content") | The height of the iframe. This can be one of the following:
|
tab_index (int or None) | Controls keyboard navigation focus. This can be one of the following:
For more information, see the tabindex documentation on MDN. |
Examples
Embed an external website:
Embed HTML content directly:
Embed a local HTML file:
Still have questions?
Our forums are full of helpful information and Streamlit experts.
