Can we change width, height, background-color, font-color of st.number_input and st.selectbox?

Can we change width, height, background-color, font-color of st.number_input and st.selectbox?

@BeyondMyself,
As far as I know no, at this point that is not possible. I have requested the same before but from what I remember and see, customizing of streamlit components is not yet available.

@BeyondMyself itโ€™s possible using the same hack you got for the color of a button. Using css selectors.

Add the following in style.css
div[role=โ€œlistboxโ€] ul {
** background-color: #99cfdd;**
}

div[data-baseweb=โ€œselectโ€] > div {
** background-color: #99cfdd;**
}

div[data-baseweb=โ€œinputโ€] > div {
** background-color: #99cfdd;**
}

And include the following lines in .py file

from load_css import local_css
local_css(โ€œstyle.cssโ€)

1 Like