Tags custom component for Streamlit
Project description
Streamlit-tags
A custom component to have Tags in Streamlit.
Please star the repo and share the usage if you liked it.
Check out docs here:
Updates
Now streamlit tags also supports theming and all the colours
Install
pip install streamlit-tags
The installation can also be found on PyPi
Usage
This library has two main functions to display and use tags:
st_tags
to display the tags featurest_tags_sidebar
to display the tags in the sidebar
Check the examples/
folder of the project a quick start.
Check out demo here: https://share.streamlit.io/gagan3012/streamlit-tags/examples/app.py
Definition
def st_tags(label: str,
text: str,
value: list,
key=None) -> list
'''
:param label: (Str) Label of the Function
:param text: (Str) Instructions for entry
:param value: (List) Initial Value
:param key: (Str)
An optional string to use as the unique key for the widget.
Assign a key so the component is not remount every time the script is rerun.
:return: (List) Tags
'''
We also have a function now to embed the tags function to the sidebar:
def st_tags_sidebar(label: str,
text: str,
value: list,
key=None) -> list:
'''
:param label: (Str) Label of the Function
:param text: (Str) Instructions for entry
:param value: (List) Initial Value
:param key: (Str)
An optional string to use as the unique key for the widget.
Assign a key so the component is not remount every time the script is rerun.
:return: Tags
'''
Example Usage
import streamlit as st
from streamlit_tags import st_tags
keywords = st_tags('Enter Keyword:', 'Press enter to add more', ['One', 'Two', 'Three'])
st.write(keywords)
UI for st_tags
UI for st_tags_sidebar
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
streamlit_tags-1.1.1.tar.gz
(559.6 kB
view hashes)
Built Distribution
Close
Hashes for streamlit_tags-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9af5381603363c2c3c8fd54a434529ae681cbe06b4b7e2be365de5de42420bd7 |
|
MD5 | 23cd02765d2e330de7cdf95327cb66a1 |
|
BLAKE2b-256 | bca5f0521f3823e7efd861dff02d8295f6c984e26cd44651dabfd522ba910745 |