blackary / st_pages

An experimental version of Streamlit Multi-Page Apps
MIT License
456 stars 76 forks source link

Section Pages aren't indented #65

Closed murp-2075 closed 1 year ago

murp-2075 commented 1 year ago

Love the library so cool, but noticed a tiny issue.

If I create sections and don't call add_page_title() on the page, the sections don't indent.

show_pages(
    [
        Page("app.py", "Home", "🏠"),
        Section(name="My section", icon="🎈️"),
        Page("pages/1_test.py", "test1 ", ":shark:", in_section=True),
        Page("pages/2_boom.py", "bang", "💥", in_section=True),
    ]
)
add_page_title()

Unless I add that last line, everything is left aligned.

I've recreated this on Chrome and Safari.

blackary commented 1 year ago

This is expected behavior -- see the note in the README

from st_pages import show_pages_from_config, add_page_title

# Either this or add_indentation() MUST be called on each page in your
# app to add indendation in the sidebar
add_page_title()