How to hide the new download button from st.dataframe

I recently upgraded to 1.28.1 and now the st.dataframe has the download button on the top.
I have an application where I should not allow the user to do that.
How can it be hidden?

Will I need another CSS trick?

Nothing was mentioned on the Docs:

2 Likes

How about if users just copy paste the table.

1 Like

That is not my point here. What I don’t want is to “advertise” the download by showing a button every time he moves the mouse over.
For now I need to hide the button.

3 Likes

Also having this issue! would love if there was a way to disable it. Users currently can’t copy and paste from it so just need to have them not be able to download as well.

2 Likes

I have the same issue. I have created some code with my database being displayed as a dataframe for inspection. the last thing I want to do is to allow the user to either download it or copy paste it. (a simple enable copy / download true/false would do)

1 Like

Yes this essential, when some new feature is added in streamlit, there should be always both enable and disable in APIs.

4 Likes
/* For Removing download icon on dataframe  */
[data-testid="stElementToolbar"] {
    display: none;
}
3 Likes

where do you add this (data-testid)? in a markdown block?

Facing similar issue.

  1. There should be an option to enable and disable the download button.
  2. also there’s some limit of records above which it doesn’t show any options on the top right. what’s the exact limit?

Yes, add the following code snippet to the page that contains your dataframe:

            st.markdown(
                """
                <style>
                [data-testid="stElementToolbar"] {
                    display: none;
                }
                </style>
                """,
                unsafe_allow_html=True
            )
7 Likes

Thank you! This worked for me as well; I really want to hide the obvious “download” button. Thanks!

Is there any solution to hide search/download, without using unsafe_allow_html = True.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.