Hi,
Quick question: Any tips on adjusting the height of Streamlit components? I’m working on a project and would love to hear your insights or best practices.
Thanks a bunch!
Hi,
Quick question: Any tips on adjusting the height of Streamlit components? I’m working on a project and would love to hear your insights or best practices.
Thanks a bunch!
Hi @Fatemeh_Norouzi,
Thank you for sharing your question with the community!
Your post is missing a code snippet and a link to your app’s GitHub repo. Please check out our guidelines on how to post an effective question here and update your post to help the community answer your question.
As @tonykip had pointed out, it would be great if you also share your code snippet so that the community can see exactly the issue that you’re encountering.
Guessing from the limited information on adjusting the height of Streamlit component, are you referring to the html component functionality, by default the height
parameter is set to 150 pixels, thus you can adjust this number to a height that best display the underlying page content that you are displaying.
More info here in the Docs page:
Components API - Streamlit Docs
Hello, appreciate your response. I’m not referring to HTML; I’m discussing Streamlit elements such as st.multiselect. Here’s my code, and I’m looking to adjust the height of “day_of_week” so that it matches the uniformity of the other elements.
for i in range(station_num):
container_1 = st.container()
with container_1:
print(container_1.write('this is the container1'))
name_station, num_charging, name_charging, day_week, arrive_time, stay_l, = st.columns(6)
with name_station:
station_name = st.text_input(f"Station{i+1} Name:", value=f"Station {i+1}",key=f'station_name_{i}')
with num_charging:
charging_number = st.number_input(f"Charging station number:", min_value=1, value=2, step=1, key=f'charging_station_number_{i}')
charging_stations = []
for j in range(charging_number):
with name_charging:
charging_station_name = st.text_input(f"Charging Station Name:", value=f"Station {j+1}",key=f'charging_station_name_{i}_{j}',help="charging number")
with day_week:
options_week_day = ['Monday','Tuesday','Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
day_of_week = st.multiselect(f'week day(s):', options_week_day, default=['Sunday'],key=f'day_of_week_{i}_{j}')
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.