Skip to main content
A user input component with a simple on/off status.

Fields

NameTypeDescriptionOptions
LabelText--
AccentColor--
Primary textColor--
SeparatorColor--
Custom CSS classesTextCSS classes, separated by spaces. You can define classes in custom stylesheets.-

Events

Sent when the switch is toggled.
def handle_toggle(state, payload):

# The payload will be a bool 

state["its_on"] = payload
I