Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Selective Icon Assignment for Option Menu #72

Open
cptbmate opened this issue Jun 6, 2024 · 2 comments
Open

Feature Request: Selective Icon Assignment for Option Menu #72

cptbmate opened this issue Jun 6, 2024 · 2 comments

Comments

@cptbmate
Copy link

cptbmate commented Jun 6, 2024

Hi,

I would like to request an enhancement to the streamlit-option-menu component that would allow for more flexible icon assignment. Specifically, I would like to see the following features:

Selective Icon Assignment: The ability to assign icons to only specific options within the menu. Currently, the icons list must match the length of the options list, and providing empty strings or None still results in default icons being displayed.

No Icon Option: An option to specify that no icon should be displayed for certain menu items. This could be implemented by allowing a specific value (e.g., None or an empty string) in the icons list to explicitly indicate that no icon should be shown for that particular item.

Example Use Case:
I have a menu where I want to display an icon only next to the "SEARCH" option and no icons next to other options. Here’s a simplified version of the menu configuration:

selector = option_menu(
    None, 
    ["SEARCH", "ALL", "5Y", "1Y", "YTD"], 
    icons=['search', None, None, None, None], 
    menu_icon=None,  
    default_index=0, 
    orientation="horizontal",
)

Thank you!

@CHerSun
Copy link

CHerSun commented Jun 6, 2024

Away from my pc now - can't check for sure, but as far as I remember any nonexistent name gives you no icon, like "-"

@cptbmate
Copy link
Author

Away from my pc now - can't check for sure, but as far as I remember any nonexistent name gives you no icon, like "-"

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants