st.components.v1.iframe
Deprecation notice
st.components.v1.iframe was deprecated in version 1.56.0 and will be removed in a later version. Use st.iframe instead.
Load a remote URL in an iframe.
To use this function, import it from the streamlit.components.v1 module.
| Function signature[source] | |
|---|---|
st.components.v1.iframe(src, width=None, height=None, scrolling=False, *, tab_index=None) | |
| Parameters | |
src (str) | The URL of the page to embed. |
width (int) | The width of the iframe in CSS pixels. By default, this is the app's default element width. |
height (int) | The height of the frame in CSS pixels. By default, this is 150. |
scrolling (bool) | Whether to allow scrolling in the iframe. If this False (default), Streamlit crops any content larger than the iframe and does not show a scrollbar. If this is True, Streamlit shows a scrollbar when the content is larger than the iframe. |
tab_index (int or None) | Specifies how and if the iframe is sequentially focusable. Users typically use the Tab key for sequential focus navigation. This can be one of the following values:
For more information, see the tabindex documentation on MDN. |
Examples
import streamlit.components.v1 as components
components.iframe("https://example.com", height=500)
Still have questions?
Our forums are full of helpful information and Streamlit experts.