Skip to content

🔛  Toggle Switch

Submitted by Carlos D. Serrano

Summary

On/Off Toggle Switch with color customizations. Note that this is now available as a native Streamlit command st.toggle. Check out the docs!

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
    )