import panel as pn pn.extension()
Switch widget allows toggling a single condition between
False states by ticking a switch. This widget is interchangeable with the
Discover more on using widgets to add interactivity to your applications in the how-to guides on interactivity. Alternatively, learn how to set up callbacks and (JS-)links between parameters or how to use them as part of declarative UIs with Param.
value(boolean): Whether the switch is on or off
disabled(boolean): Whether the widget is editable
name(str): The title of the widget
switch = pn.widgets.Switch(name='Switch') switch
Switch.value parameter is either True or False depending on whether the switch is ticked.