Hi All
I have a streamit based program which shows a heading and 3 options as radio buttons as below:
options = [“A”, “B”, “C”]
options = [“”] + options
source_var = st.radio(“Select the appropriate option:”, options, index=0)
Now, when I execute it, it is giving radio buttons with options but only problem I have is that these radio buttons appear one after another in different line but the SPACES between two lines is very less…I want at least 2 line gap between any two radio buttons.
Current image:
Select the appropriate option:
o A
o B
o C
I want this to appear with extra space, like:
Select the appropriate option:
o A
You can modify the CSS gap property of the radio options:
import streamlit as st
st.markdown("""
<style>
[role=radiogroup]{
gap: 3rem;
}
</style>
""",unsafe_allow_html=True)
st.markdown("## Vertical gap for `st.radio`")
st.radio("Options", options=[f"Option {i}" for i in range(1,5)])
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.