Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add height and key to st.columns #10023

Open
2 tasks done
iscoyd opened this issue Dec 13, 2024 · 4 comments
Open
2 tasks done

Add height and key to st.columns #10023

iscoyd opened this issue Dec 13, 2024 · 4 comments
Labels
feature:st.columns type:enhancement Requests for feature enhancements or new features

Comments

@iscoyd
Copy link

iscoyd commented Dec 13, 2024

Checklist

  • I have searched the existing issues for similar feature requests.
  • I added a descriptive title and summary to this issue.

Summary

It would be great if the features of st.columns() and st.container() could be combined in a single API call, say st.columns(). For example, if one wants to create two scrollable fixed-height side-by-side columns one has to first instantiate two columns with cols = st.columns(2), and then create a st.container() within each column for a specified fixed height.

Why?

Presently, st.columns() allows one to create multiple columns side by side, but one can neither make them fixed height scrollable. And with st.container(), one can make the container fixed height & scrollable, but there is no way to place containers side by side. This is frustrating when writing code since one has to remember these two types of behavior for the two functions when they could easily be rolled into a single function.

How?

The present st.columns() API call is:
st.columns(spec, *, gap="small", vertical_alignment="top", border=False)

and the st.container() API call is:
st.container(*, height=None, border=None, key=None)

Simply add to st.columns() three of the parameters of st.container(), namely height, border and key. If you can do this this, there will be no need for st.container(), which will make it far easier for programmers.

Additional Context

No response

@iscoyd iscoyd added the type:enhancement Requests for feature enhancements or new features label Dec 13, 2024
Copy link

To help Streamlit prioritize this feature, react with a 👍 (thumbs up emoji) to the initial post.

Your vote helps us identify which enhancements matter most to our users.

Visits

@iscoyd
Copy link
Author

iscoyd commented Dec 14, 2024 via email

@jrieke
Copy link
Collaborator

jrieke commented Dec 16, 2024

FYI we just added a border parameter to st.columns in 1.41. It's possible we'll also add the height parameter at some point but I'll probably wait with that since we want to do a more general pass at layout features early next year.

I'll update the title of this issue to make it a bit more explicit.

@jrieke jrieke changed the title Combine the capabilities of st.columns() and st.container() into a single API function Add height and key to st.columns Dec 16, 2024
@iscoyd
Copy link
Author

iscoyd commented Dec 22, 2024

Thank you, that will help greatly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:st.columns type:enhancement Requests for feature enhancements or new features
Projects
None yet
Development

No branches or pull requests

2 participants