What problem does it solve?
Managing navigation, shared session state, and modular page organization across multiple Streamlit pages can be error-prone and lead to duplicated UI, inconsistent state initialization, and brittle imports; this Skill provides clear structure and patterns to avoid those pitfalls.
Core Features & Use Cases
- Entrypoint pattern: Centralized streamlit_app.py that initializes shared state, defines navigation, and runs the selected page so page modules remain focused on content.
- Navigation strategies: Guidance for top navigation for small apps and sidebar or grouped navigation for many pages, including mixed ungrouped sections.
- State management: Best practices for initializing global session state in the main module and using prefixed keys for page-specific state to avoid collisions.
- Programmatic flows: Examples for switching pages programmatically, building conditional page lists (auth, roles, feature flags), and safe import conventions for page modules.
- Use Case: Ideal for developers building dashboards, admin consoles, or analytics tools that require consistent navigation, shared widgets, and modular page code.
Quick Start
Create a streamlit_app.py entrypoint that initializes needed st.session_state keys, constructs a st.navigation over an app_pages directory (home, analytics, settings), displays shared UI like the title, and calls page.run() to render the selected page.