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)
1 Like

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