St.logo Image size

The default size for st.logo is 24px, which is very small.
Is there any option to resize this to something like 100px?
st.logo is only for streamlit version 1.35.0

5 Likes

Also have the same issue

I’m really looking forward for this option. As of now, it’s quite limiting not be able to set the size (it would be a couple of parameters in the method signature), although some CSS tricks can do a pretty decent job!

I’ve manually updated the stylesheet via st.markdown(...). The following CSS adjust the sizes and vertically align everything (it’s out of scope but was too ugly from my perspective):

<style>
  div[data-testid="stSidebarHeader"] > img, div[data-testid="collapsedControl"] > img {
      height: 3rem;
      width: auto;
  }
  
  div[data-testid="stSidebarHeader"], div[data-testid="stSidebarHeader"] > *,
  div[data-testid="collapsedControl"], div[data-testid="collapsedControl"] > * {
      display: flex;
      align-items: center;
  }
</style>
2 Likes

Thank you so much!

Yeah, I found similar CSS elsewhere. I was just wondering if there was an easier and cleaner way to do it.

Hello,
As per me the default st.logo in Streamlit version 1.35.0 from 24px to 100px, you can use custom CSS. Streamlit allows you to inject custom HTML and CSS to adjust the appearance of your app .
You can use this ;
1 Use the st.markdown function to inject custom CSS.
2 Define a style block to set the desired size for the logo.
Thanks

An issue was raised at streamlit github.

I’m just seeing this, but wouldn’t it be easier to just insert this css:

img[data-testid="stLogo"] {
            height: 3.5rem;
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.