Is there any chance that I can remove the "Drag and drop file here" of file_uploader

I want to remove the text, is there any approach? Thanks!!!

Hi @Weaver_Maltis, welcome to the Streamlit community!

It’s probably possible to remove it using CSS…what use case are you solving for? Usually, those labels are there to provide context to the users, giving them a hint on the expected workflow.

Best,
Randy

I’m a Chinese user and I want to change the text to Chinese, but I know little about CSS.

Great reason :slight_smile:

I couldn’t figure out how remove it, but I figured out how to modify it in-place. Not sure how stable this will be across versions of Streamlit, but you can try this (used Google translate, so obviously put the right text as desired):

st.markdown(
    """
    <style>
        .css-9ycgxx::after {
            content: " 拖放";
        }
    <style>
    """, unsafe_allow_html=True)

fileup = st.file_uploader("Hello")


Best,
Randy

1 Like

Thanks, Randy. You‘ve been a great help to me!

Hi, Randy!

Your answer really helped me too! I’m only struggling while trying to do this for 2 Drag&Drops… how does the code change in order to achieve this?

Sincerely,

Ailyn

I think it is not a complete solution, only use css.after, the “Drag and …” cannot remove

This will very likely not work in future streamlit versions, because the class may change, but here’s a way to hide that line:

import streamlit as st

file_uploader = st.file_uploader(label="Upload a file")

hide_label = """
<style>
    .css-9ycgxx {
        display: none;
    }
</style>
"""

st.markdown(hide_label, unsafe_allow_html=True)