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

st.switch_page() feature not supported by navbar #14

Open
3 tasks done
neldivad opened this issue Jun 13, 2024 · 0 comments
Open
3 tasks done

st.switch_page() feature not supported by navbar #14

neldivad opened this issue Jun 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@neldivad
Copy link

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

Navbar does not allow transitioning with st.switch_page(). Will behave exactly like streamlit default multipage onwards.

Reproducible code example

# main.py
import streamlit as st
from streamlit_navigation_bar import st_navbar
import pages as pg

page = st_navbar(["Home", "Documentation", "Examples", "Community", "About"])

if page == 'Home':
    pg.homepage()
elif page == 'Documentation':
    pg.app1_page()
# pages/__init__.py

from .home import homepage
from .app1 import app1_page
from .app2 import app2_page
# pages/home.py
import streamlit as st

def homepage():
    st.title('Home')

    if st.button("Page 1"):
        st.switch_page('pages/app1.py')
# pages/app1.py
import streamlit as st

def app1_page():
    st.title('App 1')


### Steps to reproduce

_No response_

### Expected behavior

Takes me to a different page while keeping the navbar UI. 

### Current behavior

Takes me to streamlit default multipage UI. No other way to revert to navbar UI other than going back to the app's origin. 

### Is this a regression?

- [ ] Yes, this used to work in a previous version.

### Debug info

- Streamlit version: 1.35
- Streamlit Navigation Bar version: 3.3.0
- Python version: 3.11
- Operating System: Windows
- Browser: Google chrome


### Additional information

_No response_
@neldivad neldivad added the bug Something isn't working label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant