mrcblt / streamlit-toggle

Toggle widget for Streamlit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A toggle switch widget for Streamlit

Toggle Switch

Installation

To build the library Node.js has to be installed. If you are using Anaconda/Miniconda you can install it with the following command:

conda install -c conda-forge nodejs=16

The npm executable has to be in your PATH.

You can finally build and install streamlit-toggle automatically by pip with the command:

pip install .

For this you have to be in the root directory of this repository.

Usage

import streamlit as st
from streamlit_toggle import st_toggleswitch

awesomeness_enabled = st_toggleswitch("Enable awesomeness")
if awesomeness_enabled:
    st.write("Awesomeness has been enabled!")

Copyright notice

This is a fork of the project samdobson/streamlit-toggle by Sam Dobson.

About

Toggle widget for Streamlit

License:MIT License


Languages

Language:TypeScript 83.8%Language:Python 11.3%Language:HTML 4.0%Language:Shell 0.8%