List/table input widget
See original GitHub issueProblem
We need to take some complex data or configuration from the user in a GUI way.
But streamlit currently allows the following types of input:
- text
- text area
- number
- slider (number)
- slider selection (str)
- checkbox (bool)
- multiselect
- radio
(am I missing something ?)
-
Streamlit does not have a list input. Something where users can click a small
+
icon and add any number (min and max may be defined) of items to a list. Each item on the list may be a text or number. -
Streamlit does not have a dict input, where the user can give some key-value pairs, and add items to the dict.
this image gives the flavor of what I am trying to say.
you see the + icon and the delete icon. they should allow an arbitrary no of items in a list or dict.
Solution
It would be great if we could input more complex custom types in streamlit. (beyond list and dict as said above)
For example, we may define a pydantic base model, and streamlit would input that.
from typing import List
from pydantic import BaseModel
import streamlit as st
class MyCustomData(BaseModel):
name: str
age: int
friends: List[int]
st.get_input(MyCustomData) # imaginary
Some code like shown above should generate a form to input the data of the structure defined.
Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.
If you’d like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:13
Top GitHub Comments
Hi, Streamlit does have a way to add lists its called streamlit-tags Check it out here: https://github.com/gagan3012/streamlit-tags
That is really a good idea! It will make the speed of develop an App faster, because it provided some methods that used widely in it. That is the value of Streamlit.
By the way, it is easily to make the method come true. Just create a “widget” with some methods which Streamlit had yet. The only problem of it is change the style of buttons.