I’m trying to create tabs that works independently on Streamlit.
The official documentation explains here how to create three tabs for eg. and it works fine. But when I change the code of (let’s say the Cat’s tab) so can an error be raised, I can’t anymore switch to Dog’s tab or Owl’s tab.
CODE :
import streamlit as st
tab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])
with tab1:
st.header("A cat")
st.image("_", width=200) # I changed here on purpose to raise an error
with tab2:
st.header("A dog")
st.image("https://static.streamlit.io/examples/dog.jpg", width=200)
with tab3:
st.header("An owl")
st.image("https://static.streamlit.io/examples/owl.jpg", width=200)
Hi @Shawn_Pereira, thank you so much for the support.
Is there by any change a way we can streamlit to not run the code inside a specific tab ?
Actually I have three tabs, the first one takes about 1 minute to display the result (because it proccess some big dataframes with pandas), so it means that I can’t switch to tab2 unless the tab1’s instructions are fully executed. It means I have to wait one minute before switching to tab2 or tab3.
@Shawn_Pereira, I used st.radio and the conditionnal works fine.
Only one problem, I tried to style the buttons but the code below does not work unfortunately :