Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit_autosuggest-0.2.1.tar.gz (445.1 kB view details)

Uploaded Source

Built Distribution

streamlit_autosuggest-0.2.1-py3-none-any.whl (448.6 kB view details)

Uploaded Python 3

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

Hashes for streamlit_autosuggest-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7ad25c8465807f8358632a4a6f522f2c52afde0f24ae431ace9cf889aa72e62f
MD5 460c3bbf94c62d4340d0f7b818849e1a
BLAKE2b-256 5098f126040830fe5aaa288f8883ad11b0ef902133a59a03621da2cd46c759f5

See more details on using hashes here.

File details

Details for the file streamlit_autosuggest-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_autosuggest-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 337262cbc622e5a299046fbaf7cfd56b35dbdf986531817a6c5bcdddc3bb5d43
MD5 67dcfad700f93090c95e994ae993dec2
BLAKE2b-256 c424977bf0f0daa6ca2f928f27204e0708f269147af8cca92f1addc9d046a703

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page