streamlit-pydantic
streamlit-pydantic copied to clipboard
Displaying Input Sections in Columns
Feature description:
As far as I understand at the moment User Input will all be displayed in one colum. As seen here
But instead i would like to display the interactive fields in multile colums, As seen here:
Maybe one could specify the number of input columns as name-value pair:
input_data = sp.pydantic_input(
"model_input", model=ExampleModel, width=2
)
Additionaly if the width value equals None, the Number of Collums could be automaticly determined to approximate for e.g. a 3 by 4 aspect ratio. If the window size is to narrow streamlit rearranges the elements anyway.
Problem and motivation: The motivation is clearly to make apps with a lot of user input more organised and utilize more of wide screen displays. This is espacially sensible, since streamlit-pydantic is a usefull tool espacially in applications with a lot of user input, to make code more organised and modular.
Is this something you're interested in working on? Yes, although I am totally inexperienced
@BenediktPrusas Thanks for your suggestion :) This would be definitely a useful feature. However, it might be a bit more complicated to implement this since we need to find a good way to automatically determine which UI elements should be put into which column. Since the different UI elements can have different sizes, just splitting them into an equal number of items might not be the desired solution. I have to do a bit of experimentation on this to get it right :)
Btw. for the use-case above, an multi-select element might also be a good alternative. You can achieve this with streamlit-pydantic
by using a set of enum values (example).
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days
This looks like a very good enhancement and I would love to have this too!
Maybe this could be split in something like
input_data = sp.pydantic_input(
"model_input", model=ExampleModel, columns=[1, 3],
preset_columns={'big_column': 1, 'small_column': 0, 'another_big_column': 1}
)
That way there will be no need to make logic about which setting should be in which column and the user can configure this for himself.
If this is not configured, than it will directly split every setting in the defined columns.
And also - I think that the streamlit column functionality should be used also with the ability to specify the column width
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days