Hey guys,
Unfortunately I was unable to find an answer here on the forum that could guide me.
I can create custom “Markdown HTML”, but I cannot capture the selection change.
The images are .png files of American and Brazilian flags, transformed into base64 to function as icons.
Please, can you tell me some way to achieve my goal?
Thanks for the directions.
But I had already read each of them and was unable to obtain or make adjustments to any of them in my code (which would produce the desired effect).
In the case of the ‘flags’ lib (which would ‘come closer to what is desired’) the icons relating to the ‘US’ and ‘BR’ flags, when rendered, appear only as strings and in the case of ‘GBENG’ a small black flag appears.
In this code example, the smiley icon that appears on the label was the type of effect I would like for radio buttons
import flag
st.radio('Test flag icon :smile:', (flag.flag('BR'), flag.flag('US'), flag.flag('GBENG') ))
Maybe I wasn’t able to correctly convey my objective in the initial post.
I would like to have just one flag icon (related to the dashboard’s language options) next to each radio button.
The ‘Mardown’ HTML that I created partially fulfills this proposal. I just can’t somehow detect the selection change.
(I even tried using js script and checked other posts here on the forum. They don’t seem to work within Streamlit)
I just saw something strange around here…
When I view this post on my smartphone the flags appear exactly as expected.
But on my computer the browser doesn’t display it the same way (it just shows string instead of the flag image).
The worst thing is that I tested it on 2 different browsers, Chrome Version 120.0.6099.225 (Official Build) 64-bit and MS Edge Version 120.0.2210.144 (Official Build) (64-bit)
The app shown above was implemented via st-lite and displayed in an iframe of the above forum post, and it seems to be causing issue for your access in a Chrome browser. However, have you tried to deploy the app and access it via your browsers.
I’ve tested by deploying the app and it seems to be working for me on the Chrome browser.
Hi @dataprofessor
Thanks for the tip, but as it’s still under development I haven’t deployed it yet.
As soon as I can I will try to deploy and see what happens.
From my laptop, with a virtual machine using Ubuntu 22.04.3 LTS, with an updated version of Firefox before installing the indicated font, it was possible to see in the stLite editor (shared by @blackary), but it did not render in the panel on the side (mentioned earlier with a ‘security’ error detected by Firefox)
After installing the suggestion on the Ubuntu virtual machine, firefox stopped displaying the flags in the editor. Removing the suggestion went back to what it was before
On the Samsung S20FE/Andoid smartphone it continues to work normally with any of the above links.
Thanks for investigating further. It seems that the smartphone is the working option from the devices that you’ve tried. Could it be a proxy/internet connectivity issue? Can you try using your phone to share internet connection to your other device that you’ve tried previously to see if that changes anything.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.