Adding hyperlink to radio Options

Hi
I am trying to create a radio options as per st.radio<!-- --> - Streamlit Docs

I need to add hyperlinks to both Label and Options. I can sucessfully add hyperlink to Label, but adding hyerlink is not working with Options strings. I understand that the documentation link above do not say Links are supported for Options, so i don’t expect it to work by default.

But i am wondering it there any workaround to achieve this ?
If not, please you may consider this an enhancement request.

Here is sample code

link='check out this [link](https://retailscope.africa/)'
st.session_state['database_name'] = st.sidebar.radio("[Choose Database](https://stackoverflow.com/) :" ,
                                (link,
                                "[Sales Content](https://www.projectpro.io/) :",
                                 "Technical Content"))

image

Hi @Santhosh_M

Unfortunately, the options parameter does not support markdown links. However, the captions parameter does!

Consider the following code snippet:


import streamlit as st

genre = st.radio(
    "What's your favorite movie genre",
    [":rainbow[Comedy]", "Drama", "Documentary :movie_camera:"],
    captions = ["Laugh out loud.", "Get the [popcorn](http://www.google.com).", "Never stop learning."])

which generates a clickable link as shown in the screenshot below:

Hope this helps!

1 Like

Thanks for the workaround, this is great and helps.
Still if streamlit development team can add similar capability within Options, that would some real estate space on the GUI.

1 Like

Glad that it works now!

If you’d like to file for a feature request, you can do so at Issues · streamlit/streamlit · GitHub

Thanks I have submitted a feature request
# Provide a feature for markdown link for Options parameter in st.radio. #7992

1 Like

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