A Streamlit custom component to load heart-shaped Toggle Switch
Project description
Streamlit Custom Toggle
A custom component to load heart-shaped Toggle Switch widget
Installation ⬇
pip install streamlit-custom-toggle
Example Usage
Copy this code snippet
import streamlit as st
from streamlit_custom_toggle import st_custom_toggle
st.header('Music Choices')
col1, col2, col3 = st.columns(3, gap="small")
with col1:
calm = st_custom_toggle('Calm', active_track_fill="#EAE4E4", active_thumb_color="#EAE4E4", value="true", key="toggle1") # Disabled toggle switch
with col2:
fun = st_custom_toggle('Fun', active_track_fill="#57FD6E", active_thumb_color="#EAE4E4", key="toggle2")
with col3:
music_toggle = st_custom_toggle('Rock', active_track_fill="#FF5733", active_thumb_color="#900C3F", key="toggle3")
music = st.radio(
"Select your favorite artist",
('The Beatles', 'AC/DC', 'Pink Floyd', 'Elvis Presley', 'MÃ¥neskin'), disabled=music_toggle)
st.markdown(f"You choose {music}")
# Checking the toggle state
st.code(f"Calm = {calm}, Fun = {fun}, Rock = {music_toggle}")
References
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-custom-toggle-0.1.1.tar.gz
(549.1 kB
view hashes)
Built Distribution
Close
Hashes for streamlit-custom-toggle-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a72ca0e9ea56e31d32ee68b23dc2e6737621058c0544c7c7c0ebcc55495d1ea |
|
MD5 | 27e4725418554e9234b72d8a9a5aca10 |
|
BLAKE2b-256 | 0e7f7a3252371baf29416a26c184a90ce24aa04da9581f186dbb7b87aebbbf19 |
Close
Hashes for streamlit_custom_toggle-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51fda67ad1c95c8fc9abf2a6987f8ff279dad8fd5de138220d2cf4d832431f33 |
|
MD5 | 77fdad1d066a1bf47cba58c52bc49f5e |
|
BLAKE2b-256 | 41bf0b38d2db274b945def12fee8520b8cae2968ca6e6973091388d9f018a762 |