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

Jumpy navigation bar fix #33

Open
alon-sht opened this issue Aug 27, 2024 · 0 comments
Open

Jumpy navigation bar fix #33

alon-sht opened this issue Aug 27, 2024 · 0 comments

Comments

@alon-sht
Copy link

I found this very nice component
https://github.com/bouzidanas/streamlit-float/

Combining streamlit-float with the nav bar 'pinned' mode, makes it sticky and prevents it from being jumpy

Example:

import streamlit as st
import hydralit_components as hc
from streamlit_float import float_init

st.set_page_config(layout="wide")
menu_container = st.container()
with menu_container:
    menu= hc.nav_bar(
        [
            {"icon": "bi-info-circle-fill", "label": "Page 1"},
            {"icon": "bi-bar-chart-fill", "label": "Page 2"},
            {"icon": "bi-search", "label": "Page 3"},
        ],
        key="test_menu",
        sticky_mode="pinned",
    )
menu_container.float("top: 0.0rem; bottom:10rem ;z-index: 999990;")

it does require adding some blank space at the top, but it might be nice to integrate it into hc

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

1 participant