A Streamlit component for a search bar with autosuggestions
Project description
Streamlit Autosuggest Component
A custom Streamlit component that provides a searchbar with autosuggestions functionality.
Installation
You can install the streamlit-autosuggest component using pip:
pip install streamlit-autosuggest
Usage
Here's a simple example of how to use the searchbar component in your Streamlit app:
import streamlit as st
from streamlit_autosuggest import searchbar
st.title("Autosuggest Component Demo")
# Use the searchbar component
result = searchbar(suggestions=['apple', 'banana', 'cherry'], placeholder="Type a fruit name", key="demo_searchbar")
# Display the search result
if result:
st.write("You searched for:", result)
Features
- Autocomplete suggestions as you type
- Customizable suggestions list
- Customizable placeholder text
- Seamless integration with existing Streamlit applications
API Reference
searchbar(suggestions=None, placeholder=None, key=None)
Creates a new instance of the searchbar component.
Parameters:
- suggestions (list of str, optional): A list of suggestions for the searchbar.
- placeholder (str, optional): A placeholder text for the searchbar.
- key (str, optional): An optional key that uniquely identifies this component.
Returns:
- str: The selected or typed value in the searchbar.
Development
To contribute to this project, please see the GitHub repository.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Developed by Chris Weeks
Project details
Release history Release notifications | RSS feed
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_autosuggest-0.2.1.tar.gz
.
File metadata
- Download URL: streamlit_autosuggest-0.2.1.tar.gz
- Upload date:
- Size: 445.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ad25c8465807f8358632a4a6f522f2c52afde0f24ae431ace9cf889aa72e62f |
|
MD5 | 460c3bbf94c62d4340d0f7b818849e1a |
|
BLAKE2b-256 | 5098f126040830fe5aaa288f8883ad11b0ef902133a59a03621da2cd46c759f5 |
File details
Details for the file streamlit_autosuggest-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: streamlit_autosuggest-0.2.1-py3-none-any.whl
- Upload date:
- Size: 448.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 337262cbc622e5a299046fbaf7cfd56b35dbdf986531817a6c5bcdddc3bb5d43 |
|
MD5 | 67dcfad700f93090c95e994ae993dec2 |
|
BLAKE2b-256 | c424977bf0f0daa6ca2f928f27204e0708f269147af8cca92f1addc9d046a703 |