Update
Implemented custom CSS, see original post for more details.
Update
Implemented custom CSS, see original post for more details.
Try and just get this error:
TypeError: on_hover_tabs() got an unexpected keyword argument ânameâ
Apologies, I forgot to update the readme file. It should be âtabNameâ not ânameâ as the input variable.
Update
Hi there
This feature doesnât work for me⊠I used an image background in my app, it might be the reason.
The navtab works well but the rest of the app does not move with it, and leave a blank column which is not good.
I follow the code and download the CSS file:
st.markdown('<style>' + open('./style.css').read() + '</style>', unsafe_allow_html=True)
with st.sidebar:
tabs = on_hover_tabs(tabName=['Dashboard', 'Money', 'Economy'],
iconName=['dashboard', 'money', 'economy'], default_choice=0)
def main():
...
Any idea of why ?
Did you set the layout as follows?
st.set_page_config(layout="wide")
Yes.
A simple edit at the end of the CSS style document worked for me:
[data-testid="stSidebar"]{
background-color: #fff;
}
Hi, Im still seeing the blank column per Maxime_tutâs post. occurs whenever i upgrade beyond streamlit==1.11.0
any thoughts?
Hey, so sorry for the late response. I have looked into it and its an issue with streamlitâs sidebar css. It has a set min-width and a width of 335px I think. Removing those should make the package function as normal. Though I am having a bit of trouble making these changes in a css file. Will get back to you when I have figured this out.
Thanks!
So the solution:
Replace:
section[data-testid='stSidebar'] > div:nth-of-type(1) {
background-color: #111;
}
with this:
section[data-testid='stSidebar']{
background-color: #111;
min-width:unset !important;
max-width: unset !important; /*<--- This part is optional.*/
width: unset !important;
flex-shrink: unset !important; /*<--- This part is optional.*/
}
`
How to keep the text white when on specififc page? Also for me when the sidebar shrinks the icons dont show. Do you know why that would happen?
is this can be implemented with multipage builtin streamlit?
Hello, sorry for the late response. Been busy with other projects. I am working to implement this - to show a particular tab has been selected.
I have adjusted the style.css (to change properties of the streamlit sidebar) to account for some realities.
On the next update yes. Coming soon, stay tuned.
So I decided not to support this package nay further. There are far better options out there like streamlt Antd Components (github) I just stumbled on. This offers nested nav options - which was what I implemented in the latest update but its already available in this package. Combine that with the switch_page function to navigate between pages. All the best.
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.
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.
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.
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.