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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for streamlit_autosuggest-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0fb9659674df2a635e5f37ea4c9f629ddf1c89c942adcf272917a6c497537c8
MD5 c9ac34714f48f8c666f241380a5642ed
BLAKE2b-256 02b766c7ca739000ea941ab16f6383a7e864d35a1fa831cd9d55d60a69a0b568

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