streamlit-toggle-switch is a Streamlit custom component that provides a customizable toggle switch widget, offering options for color and placement. The current version is 1.0.2. The library has not seen updates since late 2022, and its functionality has largely been superseded by a native Streamlit widget.
pip install streamlit-toggle-switchVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the `streamlit-toggle-switch` component and also includes the recommended native `st.toggle` widget for comparison.
Migrate to `st.toggle`. For custom styling, consider `st.toggle` with custom CSS or alternatives like `streamlit-option-menu` if more complex navigation is needed.
Always use `import streamlit_toggle as tog` (or similar alias) after `pip install streamlit-toggle-switch`.
For complex interactions, use the native `st.toggle` with its `on_change` parameter and `st.session_state` for reliable state management. If using the custom component, explicitly manage state in `st.session_state` based on the returned value.
Ensure you have installed `streamlit-toggle-switch` correctly. The correct import path is `from streamlit_toggle import st_toggle_switch`. Some users reported success with Python 3.8.5 or 3.8.10 when encountering similar issues.
Verify installation with `pip show streamlit-toggle-switch`. Ensure your Python environment is correctly activated. If you previously installed `streamlit-toggle` (a different package), uninstall it and install `streamlit-toggle-switch`.
No dependency data recorded yet.