question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

List/table input widget

See original GitHub issue

Problem

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.

image

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:open
  • Created 2 years ago
  • Reactions:4
  • Comments:13

github_iconTop GitHub Comments

3reactions
gagan3012commented, May 7, 2021

Hi, Streamlit does have a way to add lists its called streamlit-tags Check it out here: https://github.com/gagan3012/streamlit-tags

3reactions
FHU-yezicommented, May 4, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Use The Input Widget - YouTube
We've updated the input widget and made it much more powerful with custom JS validation, spellcheck, new events, and more.
Read more >
Simple List widget - ServiceNow Docs
The Simple List widget can be used to display any list in the system within Service Portal. You can use this base system...
Read more >
ListTables - Amazon Redshift Data API - AWS Documentation
List the tables in a database. If neither SchemaPattern nor TablePattern are specified, then all tables in the database are returned.
Read more >
WP_List_Table::search_box() | Method
Displays the search box. ... ID attribute value for the search input field. ... need to manually wrap your list table (including search...
Read more >
How to pass form input fields to another component in React?
I would come up with a different component architecture here. You see, your ListTable is a child Type component, even though that is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found