How do I hide the hamburger menu from my app?

Streamlit allows developers to configure their hamburger menu to be more user-centric via st.set_page_config(). While you can configure menu items with st.set_page_config(), there is no native support to hide/remove the menu from your app.

1: A hamburger menu appears on the top-right side of your app.

You can, however, use an unofficial CSS hack with st.markdown() to hide the menu from your app. To do so, include the following code snippet in your app:

import streamlit as st

hide_menu_style = """
        <style>
        #MainMenu {visibility: hidden;}
        </style>
        """
st.markdown(hide_menu_style, unsafe_allow_html=True)

The hamburger menu will no longer appear on the top-right side of your app, as shown in the image below! ğŸŽˆ

2: Hamburger menu hidden with an unofficial CSS hack.

Was this page helpful?

editSuggest edits
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.