question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to add custom items to hamburger menu

See original GitHub issue

Related issue: https://github.com/streamlit/streamlit/issues/395

Some users would like to add items to the hamburger menu. To support this we’d have to think more deeply about the API for that. For example, would something like this be good enough for real-world use:

clicked_menu_item = st.menu_items(['Item 1', 'Item 2', 'Item 3'])

if clicked_menu_item == 'Item 1':
  do_stuff()
elif clicked_menu_item == 'Item 1':
  etc etc

What this would do: it would add “Item 1”, “Item 2”, and “Item 3” at the top of the hamburger menu, followed by a separator. All items that Streamlit puts in there would go below the separator.

(And if we implement the ability to [hide the menu](Related thread: https://discuss.streamlit.io/t/how-do-i-hide-remove-the-menu-in-production/362/3), when hidden only the Streamlit items would disappear.)


Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.

If you’d like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:21
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
MarcSkovMadsencommented, Oct 14, 2019

When you develop the api, layout and formatting of this please consider if the hamburger menu is enough. I would like to be able to make a menu at the top and fixed as well.

Just like these guys 😃

image

So maybe some options like

clicked_menu_item = st.menu_items(['Item 1', 'Item 2', 'Item 3'], expanded=True, floating=True, emphasized_items=[0])

would be cool. And if the there is not enough space on the screen to expand then it should not expand.

0reactions
aaossacommented, Apr 4, 2022

Hi, any news on this? In particular, I’m interested in just hiding the menu. Maybe I could explore the code a bit to provide a PR, but I’m not sure about how do you guys would prefer to implement this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add menu items to Hamburger menu - Hidano Template
You can add items to Navigation, then It will appear in both Desktop - Hamburger Menu. Then I will give code to remove...
Read more >
How to customize your hamburger menu in Webflow
To build your own custom hamburger menus in Webflow, you'll need the following ingredients: ... Inside the Menu Button, we'll add divs for...
Read more >
How to Create a Custom Animated Burger Menu for WordPress
The first step is to add the burger icon. You do this in your theme's header.php file. Note: If you're using a third...
Read more >
How to create Hamburger Menu for mobile devices
Hamburger Menu using html, CSS and JavaScript for mobile devices: We will write all HTML and CSS of our own and add some...
Read more >
Create a Basic Hamburger Menu Component
For the hamburger menu, I'll create a custom component which is populated by a collection. I'll read and edit a collection to show/hide...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found