Hi @Marisa_Smith !
Thanks a lot for the super useful examples above Appreciate it. I am trying to take option 3 further, and synchronize the “select all” checkbox with the multiselect’s selection (same question as @Subham). My solution below requires two clicks, however. Would you know how to make it work with only one click?
if 'toggle_checkbox' not in st.session_state: st.session_state.toggle_checkbox = True container = st.container() all = st.checkbox("Select all",value = st.session_state.toggle_checkbox) if all: selected_options = container.multiselect("Select one or more options:", ['A', 'B', 'C'],['A', 'B', 'C']) else: selected_options = container.multiselect("Select one or more options:", ['A', 'B', 'C']) if ('A' in selected_options) and ('B' in selected_options) and ('C' in selected_options): st.session_state.toggle_checkbox = True else: st.session_state.toggle_checkbox = False
Thanks in advance!