streamlit-navigation-bar

repository·main·Indexed 41 days ago

https://github.com/gabrieltempass/streamlit-navigation-bar

A Streamlit component version 3.3.0 that provides a customizable navigation bar with support for logos, external URLs, and automatic theme matching. It features the st_navbar function to manage page selection and requires Python >= 3.8 and Streamlit >= 1.33.

Tokens
536
Snippets
3
Records
5
Agent score
2%

What's inside streamlit-navigation-bar

  1. Use st_navbar for basic navigation

    main

    The st_navbar function renders a navigation bar in your Streamlit app. It accepts a list of strings representing the page names and returns the name of the currently selected page, which you can use to drive your app's logic (e.g., conditional rendering or state management).

    import streamlit as st
    from streamlit_navigation_bar import st_navbar
    
    page = st_navbar(["Home", "Documentation", "Examples", "Community", "About"])
    st.write(page)
  2. Set up the development environment for Streamlit Navigation Bar frontend

    main

    The frontend is built with Vue 3 and Vite. For the best development experience in VSCode, use the following extensions:

    1. Volar: The official Vue language service (ensure Vetur is disabled).
    2. TypeScript Vue Plugin (Volar): To enable TypeScript to recognize .vue file imports.

    Performance Tip: Volar Take Over Mode If the TypeScript plugin is slow, you can enable 'Take Over Mode' to improve performance:

    1. Open the VSCode command palette and run Extensions: Show Built-in Extensions.
    2. Find TypeScript and JavaScript Language Features, right-click it, and select Disable (Workspace).
    3. Run Developer: Reload Window from the command palette.