building-streamlit-multipage-apps

Manage multi-page Streamlit app navigation with st.navigation and shared session state.

3|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/legout/pi-config --skill building-streamlit-multipage-apps-legout
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: building-streamlit-multipage-apps
Source: https://github.com/legout/pi-config/tree/main/installed-skills/developing-with-streamlit/skills/building-streamlit-multipage-apps
Command: npx skills add https://github.com/legout/pi-config --skill building-streamlit-multipage-apps-legout

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity of managing navigation, global state, and UI consistency across multiple pages in a Streamlit application, preventing common architectural pitfalls.

Core Features & Use Cases

  • Navigation Management: Implements robust page routing using st.navigation with support for both top and sidebar layouts.
  • Global State Handling: Provides a centralized pattern for initializing and sharing session state across different page modules.
  • Use Case: Ideal for building complex dashboards or multi-step tools where users need to move between distinct functional areas like Home, Analytics, and Settings while maintaining a shared user context.

Quick Start

Use the building-streamlit-multipage-apps skill to configure a new navigation structure for my multi-page dashboard.

Frequently Asked Questions about building-streamlit-multipage-apps

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage navigation flow in a Streamlit multipage app?

Manage Streamlit multipage navigation by implementing programmatic routing using the st.navigation API within an app_pages directory structure. This approach handles page transitions and supports layouts in both the main area and the sidebar.

How do I share session state across multiple pages in Streamlit?

Share session state across Streamlit pages by initializing a centralized state pattern accessible by distinct page modules. This maintains a consistent user context as individuals navigate between different functional areas.

What is the best way to structure a complex Streamlit dashboard with multiple modules?

Structure a complex Streamlit dashboard by organizing distinct functional areas into separate modules within an app_pages directory. Use st.navigation for routing and apply centralized state patterns to ensure consistent UI layouts across pages.

Does Streamlit support conditional page rendering for multi-step tools?

Streamlit supports conditional page rendering for multi-step tools through programmatic routing via the st.navigation API. This allows you to control which distinct modules users see based on their current workflow step.

Why does my Streamlit multipage app lose user context when switching pages?

Your Streamlit multipage app loses user context when switching pages if session state is not properly initialized and shared. Implementing a centralized session state pattern across your page modules resolves this architectural pitfall.

Can I build multi-page Streamlit apps without using the app_pages directory structure?

Building multi-page Streamlit apps typically requires adherence to the app_pages directory structure to integrate properly with the st.navigation API. This structure ensures consistent UI layouts and reliable programmatic routing across modules.