Streamlit Vertical Slider

2.5.5 · active · verified Thu Apr 16

Streamlit-vertical-slider is a custom Streamlit component that creates a customizable vertical slider with various styling options including color, thumb shape, and height. It extends Streamlit's native widget capabilities to provide a vertical input method. The current version is 2.5.5, released on December 21, 2023. The project appears to have an active, though not rapid, release cadence, with significant updates in versions 2.0 and 2.5.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import and use the `vertical_slider` component with various customization options. It sets up a basic Streamlit app, displays a vertical slider, and shows its current value.

import streamlit as st
from streamlit_vertical_slider import vertical_slider

st.set_page_config(layout="centered")
st.title("Vertical Slider Demo")

value = vertical_slider(
    label="Adjust Value",
    key="my_vertical_slider",
    height=300, # Optional - Defaults to 300
    thumb_shape="circle", # Optional - Defaults to "circle" (can be "square", "pill")
    step=1,
    default_value=50,
    min_value=0,
    max_value=100,
    track_color="#D3D3D3", # Optional - Defaults to Streamlit Red (a light gray often used)
    slider_color=('red','blue'), # Optional - Can be a single color or tuple for gradient
    thumb_color="orange", # Optional - Defaults to Streamlit Red
    value_always_visible=True # Optional - Defaults to False
)

st.write(f"Current Slider Value: {value}")

# Example of how to access the value if not directly assigned
if 'my_vertical_slider' in st.session_state:
    st.write(f"Value from session state: {st.session_state['my_vertical_slider']}")

view raw JSON →