Is it possible to remove the highlight in streamlit tabs?

I’m trying to customize the streamlit tabs widget to my needs and wish to remove the bottom pink highlight. I don’t want to change my config.toml file since it’ll affect the entire app. Is there a way I can change the primaryColor for just one page or solely remove the highlight of the tabs?

1 Like
import streamlit as st

animals = ['cat','dog','bird']

tabs = st.tabs(animals)

with tabs[0]:
    st.write('Meow' + ' meow'*100)
with tabs[1]:
    st.write('Woof' + ' woof'*100)
with tabs[2]:
    st.write('Tweet' + ' tweet'*100)

css = '''
<style>
    .stTabs [data-baseweb="tab-highlight"] {
        background-color:teal;
    }
</style>
'''

st.markdown(css, unsafe_allow_html=True)

You can set the background-color: transparent; or just set display: none; if you want to hide it instead of change the color.

2 Likes

I am trying to change the color of my tabs. could you please share yours. It would be really helpful for me. Thanks

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