Page Icon

Hello, i am experiencing some issues with displaying the page_icon.
it’s a bit confusing, but here is the starting code i used :

st.set_page_config(page_title=“TITLE”, page_icon=“:bar_chart:”, layout=“wide”).

After running the app it works and every thing run correctly excepting the page icon that is not displayed, instead i have the globe icon.

Can anyone help me to explain that.

Thank you !

1 Like

Can you try passing it as a short code: page_icon=':bar_chart:' in case there is some odd behavior around character encoding?

1 Like

I can reproduce your issue using streamlit 0.17.0. I tried with both emoji and shortcode, locally and in Streamlit Cloud, latest Gnome Web and Firefox (Arch).

Here is the sample code in the docs, deployed to Streamlit Cloud:

https://favicon.streamlit.app/

You can see the code by clicking “View app source” in the hamburger menu.

2 Likes

Hello, i just tried with short code and nothing changes…

1 Like

I spun up an example and same as @Goyo I am seeing that it’s not working for either. I am trying different icons to test more “basic” emojis and also different versions of Streamlit and Python to see if there is a point at which it broke, but it appears right now to be a bug…

1 Like

Hello, Thank you for the reply.
When i click on your app i don’t have any page_icon displayed. i don’t know if it’s normal or it’s a local issue in my browser ?

1 Like

Hi everyone!

There should be a fix coming for this soon:

5 Likes

Thanks @marduk. I was searching for an open issue and I guess I missed it since it was just marked closed. There is another open issue mentioning Safari specifically, so hopefully the new fix will catch up on that bug too. set_page_config page icons do not work in Safari · Issue #2514 · streamlit/streamlit · GitHub

3 Likes

It certainly depends on browser support. For me, Gnome Web does not show any favicon but Firefox does, just not the one I asked for.
Screenshot from 2023-01-22 21-49-34

PD. The Safari issue mentioned in another answer might be affecting Gnome Web too.

3 Likes

Thank you !

1 Like

ok, Thank you !

If I understand this merged PR correctly, this fix will apply to streamlit >= 1.18.0 ?

1 Like

Bump

1 Like

Sorry not trying to spam the thread here, but can anyone confirm that this this fix will only apply to streamlit >= 1.18.0 ?

1 Like

Nobody knows the future but i think it is safe to assume that.

2 Likes

Thanks @Goyo sorry for the spamming :sweat_smile:

1 Like

Hello guys! anyone with this issue, just update streamlit version to 1.18, which is available since February 09, 2023 :v:t2:

2 Likes

I am using latest version of streamlit 1.20.0. I can’t understand how to create file py in directory /pages with emoji

for example 1_:house:_MyHome.py
my pycharm return me error: invalid file name
I am work in windows 11

1 Like

I guess you are trying to name the file using emoji shortcodes, something like:

1_:home:_Myhome.py

Copy-pasting the literal emoji directly into the filename should work:

1_🏠_Myhome.py

Result:
image


Here is a simple website to quickly search and copy emojis: https://emojidb.org/

2 Likes

Great. Thanx

1 Like