I am running a simple code locally.
import streamlit as st
st.text_input("lorem", disabled=False)
I would like not to have this fade out effect that greys out the widget. Is that possible?
I am running a simple code locally.
import streamlit as st
st.text_input("lorem", disabled=False)
I would like not to have this fade out effect that greys out the widget. Is that possible?
Hey Hi !
you can use custom HTML and CSS with streamlit also they example below may work
import streamlit as st
# Add custom HTML and CSS to style the disabled input
st.markdown("""
<style>
/* Add your custom styling here */
.disabled-input {
color: #000 !important; /* Set text color for disabled input */
background-color: #f8f9fa !important; /* Set background color for disabled input */
border: 1px solid #ced4da !important; /* Set border color for disabled input */
}
</style>
""", unsafe_allow_html=True)
# Create a text input with custom styling
st.text_input("lorem", key="my_input", disabled=False, help="This is a custom-styled input.")
# Disable the input using JavaScript after the page loads
st.script("""
document.getElementById("my_input").disabled = true;
""")
I get the error
AttributeError: module ‘streamlit’ has no attribute ‘script’
But even if I disable the text_input at run without the st.script, the fade effect still there despite your markdown style configuration.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.