Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to show again after click close button of st.sidebar #2

Open
imClumsyPanda opened this issue May 9, 2022 · 3 comments
Open

Comments

@imClumsyPanda
Copy link

Hi there, this is the coolest Streamlit sidebar component I've ever used! And I've tried for a while, and here comes a bug.

Whenever I click the close button of streamline.sidebar, there's no arrow button to show the sidebar again. I'm using streamlit 1.7.0 with streamlit-on-Hover-tabs-1.0.1

@Socvest
Copy link
Owner

Socvest commented May 10, 2022

Hello, glad you like the component. Could you send me a gif of your issue, because I have just tried it and it is still working on my end.

With st.sidebar alone

from st_on_hover_tabs import on_hover_tabs
import streamlit as st

st.sidebar.markdown("### This is with the in-built streamlit sidebar")

With st_on_hover_tabs

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'], 
                              key="1")
    
if tabs =='Dashboard':
    st.title("Navigation Bar")
    st.write('Name of option is {}'.format(tabs))

elif tabs == 'Money':
    st.title("Paper")
    st.write('Name of option is {}'.format(tabs))

elif tabs == 'Economy':
    st.title("Tom")
    st.write('Name of option is {}'.format(tabs))
    
    
st.markdown("### This is with the component + the style file active")

In essence, you don't see the sidebar button expander because the style file is active - in this file, I made it so it stays hidden. If you want to see it or use it, you'd have to adjust the style file accordingly - perhaps instead of on hover, you could use the button to trigger it and it will open and close in proportion to what is happening when you hover over it.

@Socvest
Copy link
Owner

Socvest commented Jun 7, 2022

Hey again, could you confirm if you are still having this problem? Could you show me what exactly it looks like?

@imClumsyPanda
Copy link
Author

Sorry that I haven't replied on time, I'll post my code running with error tomorrow at work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants