A Streamlit component that allows you to select from a list of options or enter a custom value.
Project description
Streamlit free text select
This component implements a selectbox that allows free text input. It is based on React-Select's 'Select' component.
Installation
pip install streamlit-free-text-select
Usage
import streamlit as st
from streamlit_free_text_select import st_free_text_select
options = ["apple", "banana", "cherry", "date", "elderberry", "fig", "grape"]
value = st_free_text_select(
label="Free text select",
options=options,
index=None,
format_func=lambda x: x.lower(),
placeholder="Select or enter a fruit",
disabled=False,
delay=300,
label_visibility="visible",
)
st.write("Free text select value:", value)
Docs
Parameters
label
: str A short label explaining to the user what this input is for.options
: list A list of predefined options to choose from.index
: int An optional index to select an option by default, defaults to None.format_func
: callable A callable function to format the options, defaults to None.placeholder
: str A string to display when the input is empty, defaults to None.disabled
: bool Whether the input is disabled, defaults to False.delay
: int The time in milliseconds to wait before updating the component, defaults to 300.key
: str An optional string to use as the unique key for the widget, defaults to None.label_visibility
: str The visibility of the label, defaults to "visible". Options are "visible", "hidden", "collapsed".
Returns str or None The value of the free text select input.
Contributors
Sander Niels Hummerich |
Lorian Coltof |
Release Notes
- 0.1.3: Enhancement: Allow dynamic updating of the options. by LorianColtof
- 0.1.2:
Bug fix: Fixed issue with
index=0
not selecting the first option. - 0.1.1:
Added the
label_visibility
andindex
parameters. - 0.0.5: Initial release.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file streamlit_free_text_select-0.2.0.tar.gz
.
File metadata
- Download URL: streamlit_free_text_select-0.2.0.tar.gz
- Upload date:
- Size: 489.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 041bf802ebd2c745001dcc43f0e1329a7715fde488c18cf674d2728dc660d06a |
|
MD5 | b7026bb707ba273f537a9c4c292d6e7a |
|
BLAKE2b-256 | d5cd6211d82ae3dc41fc20fe4d92a95511766577a535e17630491dcb85099f35 |
File details
Details for the file streamlit_free_text_select-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: streamlit_free_text_select-0.2.0-py3-none-any.whl
- Upload date:
- Size: 492.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8774ab2e1bd4852958d6f5d2c7ee2fd4f2aeca95d23988f5b47a3b3a56038f6 |
|
MD5 | f00f44b2c20eafa7d6f7fbc58f763a2e |
|
BLAKE2b-256 | 5e906b8f8bfe2fc82183af3b39ef8be64d4fb37cfee3ee869b7f494b8528307d |