Text Input Width

How can we change the width of input text/select box?

Hey @Daniyal56,

The text/select box size will always be the entire column width what it is put in. If you would like it to be smaller, then what I like to do, is to create columns with the st.beta_columns and put my widget in there.

This way you can make the width smaller.

Checkout this code for more:

import streamlit as st 

st.title("Change Text Input Width")

st.write('A standard text input:')

st.text_input('Write some text here:')

st.write("text input in columns:")

buff, col, buff2 = st.beta_columns([1,3,1])

col.text_input('smaller text window:')

gives:

Hope this helps!
Happy Streamlit-ing!
Marisa

Thanks for letting me know, But Melissa i was mistakenly mentioned about the width I was actually want to know about the height of the box, if you can please share at your earliest please

Hey @Daniyal56,

Well you can’t change the height of the text_input, but you could use text_area instead? It has a larger height and does basically the same thing!

Happy Streamlit-ing!
Marisa

1 Like