Skip to content

Commit f88d84e

Browse files
committed
Split the section about embed=true parameter of embedded Streamlit apps
1 parent c0a44d9 commit f88d84e

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

docs/hub/spaces-sdks-streamlit.md

+23-2
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,33 @@ You can use the HTML `<iframe>` tag to embed a Streamlit Space as an inline fram
7676

7777
For example, the demo above can be embedded in these docs with the following tag:
7878

79+
```
80+
<iframe
81+
src="https://NimaBoscarino-hotdog-streamlit.hf.space"
82+
title="My awesome Streamlit Space"
83+
></iframe>
84+
```
85+
86+
<iframe
87+
src="https://NimaBoscarino-hotdog-streamlit.hf.space"
88+
frameborder="0"
89+
height="600"
90+
title="Streamlit app"
91+
class="container p-0 flex-grow space-iframe"
92+
allow="accelerometer; ambient-light-sensor; autoplay; battery; camera; document-domain; encrypted-media; fullscreen; geolocation; gyroscope; layout-animations; legacy-image-formats; magnetometer; microphone; midi; oversized-images; payment; picture-in-picture; publickey-credentials-get; sync-xhr; usb; vr ; wake-lock; xr-spatial-tracking"
93+
sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads"
94+
></iframe>
95+
96+
## Embed mode
97+
98+
You can use the `embed=true` query parameter to activate the embed mode of the Streamlit app, removing some spacers and the footer for slim embeds.
99+
Please note that this parameter disables scrolling in the iframe, so you'll need to set the height of the iframe enough to fit the embedded Streamlit app's content.
100+
79101
```
80102
<iframe
81103
src="https://NimaBoscarino-hotdog-streamlit.hf.space?embed=true"
82104
title="My awesome Streamlit Space"
105+
height="364"
83106
></iframe>
84107
```
85108
@@ -94,7 +117,5 @@ For example, the demo above can be embedded in these docs with the following tag
94117
sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads"
95118
></iframe>
96119
97-
Please note that we have added `?embed=true` to the URL, which activates the embed mode of the Streamlit app, removing some spacers and the footer for slim embeds.
98-
99120
100121
Additionally, you can checkout [our documentation](./spaces-embed).

0 commit comments

Comments
 (0)