1 Star 0 Fork 0

harry.zhang/streamlit-option-menu

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setup.py 2.70 KB
一键复制 编辑 原始数据 按行查看 历史
victoryhb 提交于 2023-05-30 22:39 +08:00 . bump version
import setuptools
setuptools.setup(
name="streamlit-option-menu",
version="0.3.6",
author="Victor Yan",
author_email="victoryhb@163.com",
description="streamlit-option-menu is a simple Streamlit component that allows users to select a single item from a list of options in a menu.",
long_description="""streamlit-option-menu is a simple Streamlit component that allows users to select a single item from a list of options in a menu.
It is similar in function to st.selectbox(), except that:
- It uses a simple static list to display the options instead of a dropdown
- It has configurable icons for each option item and the menu title
It is built on [streamlit-component-template-vue](https://github.com/andfanilo/streamlit-component-template-vue), styled with [Bootstrap](https://getbootstrap.com/) and with icons from [bootstrap-icons](https://icons.getbootstrap.com/)
## Installation
```
pip install streamlit-option-menu
```
## Parameters
The `option_menu` function accepts the following parameters:
- menu_title (required): the title of the menu; pass None to hide the title
- options (required): list of (string) options to display in the menu; set an option to "---" if you want to insert a section separator
- default_index (optional, default=0): the index of the selected option by default
- menu_icon (optional, default="menu-up"): name of the [bootstrap-icon](https://icons.getbootstrap.com/) to be used for the menu title
- icons (optional, default=["caret-right"]): list of [bootstrap-icon](https://icons.getbootstrap.com/) names to be used for each option; its length should be equal to the length of options
- orientation (optional, default="vertical"): "vertical" or "horizontal"; whether to display the menu vertically or horizontally
The function returns the (string) option currently selected
## Example
```
import streamlit as st
from streamlit_option_menu import option_menu
with st.sidebar:
selected = option_menu("Main Menu", ["Home", 'Settings'],
icons=['house', 'gear'], menu_icon="cast", default_index=1)
selected
# horizontal Menu
selected2 = option_menu(None, ["Home", "Upload", "Tasks", 'Settings'],
icons=['house', 'cloud-upload', "list-task", 'gear'],
menu_icon="cast", default_index=0, orientation="horizontal")
selected2
```
""",
long_description_content_type="text/plain",
url="https://github.com/victoryhb/streamlit-option-menu",
packages=setuptools.find_packages(),
include_package_data=True,
classifiers=[],
python_requires=">=3.6",
install_requires=[
# By definition, a Custom Component depends on Streamlit.
# If your component has other Python dependencies, list
# them here.
"streamlit >= 0.63",
],
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/peapea_admin/streamlit-option-menu.git
git@gitee.com:peapea_admin/streamlit-option-menu.git
peapea_admin
streamlit-option-menu
streamlit-option-menu
master

搜索帮助