Nice / pages /1004_streamlit_option_menu.py
betterme
update
b966bc9
raw
history blame
1.63 kB
from meutils.pipe import *
import streamlit as st
from streamlit_option_menu import option_menu
st.set_page_config(page_title="Option Menu", layout="wide")
with st.sidebar:
selected = option_menu("Main Menu", ["Home", "Upload", "---", "Tasks", 'Settings'],
icons=['house', 'cloud-upload', None, "list-task", 'gear'], menu_icon="cast",
default_index=1)
selected2 = option_menu(None, ["Home", "Upload", "---", "Tasks", 'Settings'],
icons=['house', 'cloud-upload', None, "list-task", 'gear'],
menu_icon="cast", default_index=0, orientation="horizontal")
selected3 = option_menu(None, ["Home", "Upload", "Tasks", 'Settings'],
icons=['house', 'cloud-upload', "list-task", 'gear'],
menu_icon="cast", default_index=0, orientation="horizontal",
styles={
"container": {"padding": "0!important", "background-color": "#fafafa"},
"icon": {"color": "orange", "font-size": "25px"},
"nav-link": {"font-size": "25px", "text-align": "left", "margin": "0px",
"--hover-color": "#eee"},
"nav-link-selected": {"background-color": "green"},
}
)
# choice = option_menu(
# "Menu", ["首页", "HIVE", "KUDU", "MYSQL"],
# icons=['house', 'chat-square', 'chat-square-dots', 'chat-square-text'], menu_icon="hammer",
# default_index=0)
# df.style.set_precision