Streamlit component that allows you to render a menu widget with multiple columns but with only one globally selected value. It is possible to use photos for background inside the menu buttons.
Project description
Streamlit Multi Menu
With streamlit_multi_menu you can create a multi-column menu widget (with google icons or background images on the buttons). It allows you to selected just one sub menu across the whole all columns.
Installation instructions
pip install streamlit_multi_menu
Usage instructions
import streamlit as st
from streamlit_multi_menu import streamlit_multi_menu
### Define Menu
sub_menus = {"Finance":["Stock prediction","Turn around rate"],
"Cars":["Drift","Garage"],
"Food":["Ramen","Bubble Tea","Kitchen Design"]}
# Optinally you can supply google icons
sub_menu_icons = {
"Finance": ["trending_up", "sync_alt"],
"Cars": ["directions_car", "garage"],
"Food": ["restaurant", "local_cafe", "kitchen"]
}
selected_menu = streamlit_multi_menu(menu_titles=list(sub_menus.keys()),
sub_menus=sub_menus,
sub_menu_icons = sub_menu_icons,
use_container_width=True)
if selected_menu != None:
st.write("The selected menu is:",selected_menu)
Use with images inside sub menu buttons
### Define Menu
sub_menus = {"Finance":["Stock prediction","Turn around rate"],
"Cars":["Drift","Garage"],
"Food":["Ramen","Bubble Tea","Kitchen Design"]}
# Optinally you can supply google icons
sub_menu_icons = {
"Finance": ["trending_up", "sync_alt"],
"Cars": ["directions_car", "garage"],
"Food": ["restaurant", "local_cafe", "kitchen"]
}
# Urls for images
list_of_finance_imgs = ["https://cdn1.vectorstock.com/i/1000x1000/09/30/stock-market-background-or-forex-trading-business-vector-29570930.jpg",
"https://thumbs.dreamstime.com/b/three-part-cycle-diagram-white-background-53987147.jpg"]
list_of_car_imgs = ["https://as1.ftcdn.net/v2/jpg/02/74/00/80/1000_F_274008098_hp9JCh3EM3UctN4ihEYarXY3c6wM7A0e.jpg",
"https://img.freepik.com/free-vector/empty-storehouse-warehouse-interior-factory_1441-3877.jpg?size=626&ext=jpg&ga=GA1.1.1224184972.1710201600&semt=ais"]
# Assign images to corresponding column
sub_menu_imgs = {"Finance":list_of_finance_imgs,
"Cars":list_of_car_imgs}
selected_menu = streamlit_multi_menu(menu_titles=list(sub_menus.keys()),
sub_menus=sub_menus,
sub_menu_imgs=sub_menu_imgs,
sub_menu_icons = sub_menu_icons,
use_container_width=True)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
streamlit_multi_menu-0.1.0.tar.gz
(411.5 kB
view hashes)
Built Distribution
Close
Hashes for streamlit_multi_menu-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f067542f55afb7be103678a4deb4c74b4945da098f6605f6ca45aae8e32da58b |
|
MD5 | ed6fcadfee561e80c5e0d0121d0464b2 |
|
BLAKE2b-256 | a654be6680333aa2db9a6209c1b8e4e0f785ea161193898eeb91a97bc366815f |
Close
Hashes for streamlit_multi_menu-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1634a325569c22e08aa0da386f719298954fe952ff0a5a750d367e8276562d34 |
|
MD5 | 3c65ac265203b58bcf3afb1aa7d1a601 |
|
BLAKE2b-256 | 920fa8ec9e7f6da871ce39dda2d537db8eb171da8a2aee881d953ccc20dfc420 |