Skip to main content

A slider with a lot more features in it than the built in one.

Project description

streamlit-super-slider

Streamlit Super Slider

Streamlit Super Slider is a custom component for Streamlit that extends the functionality of the default slider. It provides a more interactive and user-friendly experience with additional features to enhance usability.

Features

  1. Updates Streamlit only on mouse release, not during dragging the mouse.
  2. Includes an input text box attached to the slider where changing the value in either updates the value in the other (input text changes the slider and vice versa).
  3. Arrow buttons to increase/decrease the value by one, providing a "next" or "previous" button functionality.
  4. Built-in keyboard shortcuts for quick navigation: "," (comma) for previous and "." (period) for next.

Installation

You can install the package via pip:

pip install streamlit-super-slider

Arguments

Argument Type Description Default
min_value int Minimum value for the slider. 0
max_value int (optional) Maximum value for the slider. Must be specified if values is not provided. None
default_value int (optional) The default value to set the slider to. 0
values Union[List, Dict[int,str], None] (optional) By default, the slider will have a range from min_value to max_value. Specify special set of values through a list or dict. None
dots bool (optional) If True, will show dots on the slider for each step. False
steps int (optional) Determines the spacing between the dots. None
key Any (optional) Streamlit key for the component. None

Usage

To use the Streamlit Super Slider in your Streamlit app, you simply need to import it and use the st_slider function:

import streamlit as st
from streamlit_super_slider import st_slider

st.title("Streamlit Super Slider Example")

min_value = 0
max_value = 100
default_value = 50

# Use the Streamlit Super Slider component
slider_value = st_slider(min_value, max_value, default_value)

st.write("Slider with range")
value = st_slider(values={0: "zero", 10:'10', 25:'25', max_value: "max"}, key="my_slider2" ,dots=False)
st.write("Slider custom values from dictionary and steps")
value = st_slider(values={0: "zero", 10:'10', 20:'30', 90:'90', max_value: "max"}, key="my_slider2_steps" ,dots=False, steps=10)
st.write("Slider custom values from dictionary, steps and dots")
value = st_slider(values={0: "zero", 10:'10', 20:'30', 90:'90', max_value: "max"}, key="my_slider2_dots_steps" ,dots=True, steps=10)
st.write("Slider with custom values from list")
value = st_slider(values=[0,100,350,34560], key="my_slider3")

st.write(f"Selected value: {slider_value}")

Demo

In the following demo you can see usage of the slider to show images, and all the different ways to chose where to go:

  • Keyboard shortcut
  • Pressing the arrow buttons
  • Changing the value in the input text box
  • Dragging the slider

Demo

Contributing

We welcome contributions to the Streamlit Super Slider project. If you'd like to report bugs, request features, or contribute to the code, please open an issue or submit a pull request on the GitHub repository.

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-super-slider-0.2.0.tar.gz (194.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_super_slider-0.2.0-py3-none-any.whl (946.7 kB view details)

Uploaded Python 3

File details

Details for the file streamlit-super-slider-0.2.0.tar.gz.

File metadata

  • Download URL: streamlit-super-slider-0.2.0.tar.gz
  • Upload date:
  • Size: 194.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.9.6 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.6.9

File hashes

Hashes for streamlit-super-slider-0.2.0.tar.gz
Algorithm Hash digest
SHA256 96dd0576227163c2157f3ac32b9023cb382251dd960bed0d0ae8308bcd1f6507
MD5 e6bbb9d4e881ffe2465807286d2c2f54
BLAKE2b-256 8b0fd45cb639aebd5654c5d0c8b77efe47b47d2ca08dc63affe2c6c2c7c2e9a9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: streamlit_super_slider-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 946.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.9.6 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.6.9

File hashes

Hashes for streamlit_super_slider-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85bb4748fb0212be1190a9f7805176626932b0a10adab1d345eac3a35868aeae
MD5 a2781ee2f572be8d5110a5e9adaa995f
BLAKE2b-256 ee6157c9aad4edaac1ae0c7be0c6ec7c13c96644c3ed500552d36111b6501cbc

See more details on using hashes here.

Supported by

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