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.
Release Notes
- 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.1.2.tar.gz
.
File metadata
- Download URL: streamlit-free-text-select-0.1.2.tar.gz
- Upload date:
- Size: 488.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b455c76325ccea04699319a0ccb73c7a3e86c18aa58a64aaf0ae8f1593cebaf1 |
|
MD5 | 3e5e797b102b6db53ec005921da1b4ea |
|
BLAKE2b-256 | f054ccf7128d3d503fa3618c0c36b03fa692432dc0efb6ea4e355c9819db9ed0 |
File details
Details for the file streamlit_free_text_select-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: streamlit_free_text_select-0.1.2-py3-none-any.whl
- Upload date:
- Size: 952.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3ab86f56a8ee11a3ed0043305afdb2a245692301a804e540fb0d1415b58cff6 |
|
MD5 | 60f9530af55ce89ed30ebde27d0cead7 |
|
BLAKE2b-256 | 18623949d8640aa4f98bec98e192f2fcce8815328ac9b468bb0b80c6b4d7c4d9 |