Streamlit Navigation Bar
Hi everyone!
I felt the need for a navigation bar for Streamlit apps and was not satisfied with the current solutions. So I created a component that allows anyone to place a navbar in their app. These are the guidelines I tried to follow:
- Be simple to use
- Look great out of the box
- Apply custom styles
- Integrate with Streamlit’s UI
- Have a well-written documentation
It has some cool functionalities, like displaying an optional logo and external URLs. It also matches the active theme by default.
Below are some demos using the component. I hope people find it useful!
Installation
To install it, run:
pip install streamlit-navigation-bar
Basic example
Here is a basic code example and its output:
import streamlit as st
from streamlit_navigation_bar import st_navbar
page = st_navbar(["Home", "Documentation", "Examples", "Community", "About"])
st.write(page)
More examples
Below are two other examples. To avoid having a long post, you can see the code snippets that generated them in their [Source] or in the documentation in the GitHub repository.
An example with a sidebar and applying a custom style:
An example using a logo, an external URL, multiple pages with content, among other things:
Contributing
You are welcome to help develop the Streamlit Navigation Bar! There are multiple ways to contribute, such as reporting a bug or requesting a feature. You can also just ask a question, if you want. To submit code for a pull request, make sure to read the guide on how to contribute.
Documentation
Check the complete documentation (with parameters, requirements, roadmap and more) in the GitHub repository: