Hello there,
Let’s say I have three optons in a SelectBox. They should all appear when the dropdown button it clicked, but one of these values should be greyd out and should not be able to be selected. Is there is any workaround to make this work.
Big thanks in advance
May be this Helpful :-
import streamlit as st
def custom_selectbox(label, options, disabled_options):
selected_option = st.selectbox(label, options)
if selected_option in disabled_options:
st.markdown(f"Selected option: **{selected_option}** (disabled)")
else:
st.markdown(f"Selected option: **{selected_option}**")
options = ["Option 1", "Option 2", "Option 3"]
disabled_options = ["Option 2"] # List of options you want to disable
custom_selectbox("Select an option", options, disabled_options)
Did you find a solution to this?