Load a remote URL in an iframe.

To use this function, import it from the streamlit.components.v1 module.

Warning

Using st.components.v1.iframe directly (instead of importing its module) is deprecated and will be disallowd in a later version.

Function signature[source]

st.components.v1.iframe(src, width=None, height=None, scrolling=False)

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.

Example

import streamlit.components.v1 as components

components.iframe("https://example.com", height=500)
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.