# HF Space Streamlit sidebar width and vertical scroll bar issues

**URL:** <https://discuss.huggingface.co/t/hf-space-streamlit-sidebar-width-and-vertical-scroll-bar-issues/32025>\
**Category:** Spaces\
**Created:** [February 19, 2023, 2:25pm UTC](https://discuss.huggingface.co/t/hf-space-streamlit-sidebar-width-and-vertical-scroll-bar-issues/32025 "2023-02-19T14:25:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![giswqs](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/giswqs/32/23677_2.png) [@giswqs](https://discuss.huggingface.co/u/giswqs)\
**Post date:** [February 19, 2023, 2:25pm UTC](https://discuss.huggingface.co/t/hf-space-streamlit-sidebar-width-and-vertical-scroll-bar-issues/32025/1 "2023-02-19T14:25:38Z")

</div>

I deployed a streamlit app on HF Space and noticed two issues. First, the sidebar width is too big (~1/3 of the page width).

> **[Streamlit - a Hugging Face Space by giswqs](https://huggingface.co/spaces/giswqs/Streamlit)**
>
> Discover amazing ML apps made by the community

Second, the app accessed through the direct URL does not have a vertical scroll bar.  
[https://giswqs-streamlit.hf.space/](https://giswqs-streamlit.hf.space/)

---

<div class="post-metadata">

**Author:** ![giswqs](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/giswqs/32/23677_2.png) [@giswqs](https://discuss.huggingface.co/u/giswqs)\
**Post date:** [February 19, 2023, 2:26pm UTC](https://discuss.huggingface.co/t/hf-space-streamlit-sidebar-width-and-vertical-scroll-bar-issues/32025/2 "2023-02-19T14:26:40Z")

</div>

See the same app deployed on Streamlit Cloud (no sidebar width and scrollbar issue)  
[https://geospatial.streamlit.app/](https://geospatial.streamlit.app/)

---

<div class="post-metadata">

**Author:** ![giswqs](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/giswqs/32/23677_2.png) [@giswqs](https://discuss.huggingface.co/u/giswqs)\
**Post date:** [February 19, 2023, 4:36pm UTC](https://discuss.huggingface.co/t/hf-space-streamlit-sidebar-width-and-vertical-scroll-bar-issues/32025/4 "2023-02-19T16:36:44Z")

</div>

It is probably not an iframe issue because the Space direct URL doesn’t have the vertical scroll bar either.

---

<div class="post-metadata">

**Author:** ![giswqs](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/giswqs/32/23677_2.png) [@giswqs](https://discuss.huggingface.co/u/giswqs)\
**Post date:** [February 20, 2023, 12:19am UTC](https://discuss.huggingface.co/t/hf-space-streamlit-sidebar-width-and-vertical-scroll-bar-issues/32025/7 "2023-02-20T00:19:44Z")

</div>

Besides the scrollbar problem, the direct URL [https://omnibus-static-test.hf.space](https://omnibus-static-test.hf.space) does not work.

---

<div class="post-metadata">

**Author:** ![giswqs](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/giswqs/32/23677_2.png) [@giswqs](https://discuss.huggingface.co/u/giswqs)\
**Post date:** [February 20, 2023, 3:34am UTC](https://discuss.huggingface.co/t/hf-space-streamlit-sidebar-width-and-vertical-scroll-bar-issues/32025/10 "2023-02-20T03:34:39Z")

</div>

Thank you very much for sharing your solution. I can confirm that the trick solves the vertical scrollbar issue. Hope the HF team can solve the issue so that iframing an HF space works out of the box.

Now my streamlit app has a vertical scrollbar!  
[https://streamlit.gishub.org/](https://streamlit.gishub.org/)

---

<div class="post-metadata">

**Author:** ![giswqs](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/giswqs/32/23677_2.png) [@giswqs](https://discuss.huggingface.co/u/giswqs)\
**Post date:** [February 20, 2023, 4:19am UTC](https://discuss.huggingface.co/t/hf-space-streamlit-sidebar-width-and-vertical-scroll-bar-issues/32025/12 "2023-02-20T04:19:10Z")

</div>

I also use glitch for simple static website hosting. GitHub Pages is another good option as it allows custom domains. Hope HF will support custom domains in the future.

Here is how to use GitHub custom domain to embed HF space.

> <https://github.com/giswqs/streamlit-geospatial/blob/gh-pages/index.html>

---

<div class="post-metadata">

**Author:** ![giswqs](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/giswqs/32/23677_2.png) [@giswqs](https://discuss.huggingface.co/u/giswqs)\
**Post date:** [February 20, 2023, 1:38pm UTC](https://discuss.huggingface.co/t/hf-space-streamlit-sidebar-width-and-vertical-scroll-bar-issues/32025/13 "2023-02-20T13:38:43Z")

</div>

@Omnibus I just realized that the trick does not work on mobile. No scrollbar if viewing the site on a mobile phone.

> **[Static Test - a Hugging Face Space by Omnibus](https://huggingface.co/spaces/Omnibus/static-test)**
>
> Discover amazing ML apps made by the community

---

<div class="post-metadata">

**Author:** ![giswqs](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/giswqs/32/23677_2.png) [@giswqs](https://discuss.huggingface.co/u/giswqs)\
**Post date:** [February 20, 2023, 5:31pm UTC](https://discuss.huggingface.co/t/hf-space-streamlit-sidebar-width-and-vertical-scroll-bar-issues/32025/15 "2023-02-20T17:31:47Z")

</div>

Yes, the modified css works on mobile now, but it ends up with two vertical scrollbars and a white border on desktop with a dark mode.

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/9/9a69e153e30b45487883d4d817a0ac1f15b4a7be.png)

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [February 20, 2023, 6:41pm UTC](https://discuss.huggingface.co/t/hf-space-streamlit-sidebar-width-and-vertical-scroll-bar-issues/32025/19 "2023-02-20T18:41:41Z")

</div>

hi @Omnibus and @giswqs ,  
We’re working on a fix for the static sdk, so it behaves as expected. The way I did for the gallery, was to spin off a simple Docker nginx server, you can follow it here.

**Dockerfile**

```plaintext
FROM nginxinc/nginx-unprivileged:alpine
COPY . /usr/share/nginx/html

```

**Readme.md**

```plaintext
---
title: Diffusers Gallery
emoji: 🖼️
colorFrom: red
colorTo: green
sdk: docker
app_port: 8080
fullWidth: true
pinned: false
license: mit
---

```

> **[Dockerfile · huggingface-projects/diffusers-gallery at main](https://huggingface.co/spaces/huggingface-projects/diffusers-gallery/blob/main/Dockerfile)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

[https://huggingface.co/spaces/huggingface-projects/diffusers-gallery/raw/main/README.md](https://huggingface.co/spaces/huggingface-projects/diffusers-gallery/raw/main/README.md)

---

<div class="post-metadata">

**Author:** ![DuyLoxz](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@DuyLoxz](https://discuss.huggingface.co/u/DuyLoxz)\
**Post date:** [March 8, 2023, 7:52am UTC](https://discuss.huggingface.co/t/hf-space-streamlit-sidebar-width-and-vertical-scroll-bar-issues/32025/20 "2023-03-08T07:52:57Z")

</div>

Could you explain the trick to solve the vertical scrollbar issue?
