Skip to content

๐Ÿ”›ย ย Toggle Switch

Submitted by Carlos D. Serrano

Summary

On/Off Toggle Switch with color customizations. Note: st.toggle has been released in Streamlit 1.26.0!

Docstring

Visit the PyPI page for more information.

Examples

example

def example():
    st.write("## Toggle Switch")
    st_toggle_switch(
        label="Enable Setting?",
        key="switch_1",
        default_value=False,
        label_after=False,
        inactive_color="#D3D3D3",  # optional
        active_color="#11567f",  # optional
        track_color="#29B5E8",  # optional
    )
Output (beta)